plotAcousticScene {PAMscapes}R Documentation

Plot Acoustic Scene

Description

Plots a representation of the acoustic scene using detections in data. Frequency ranges for detections are taken from user input and displayed as different colored bars

Usage

plotAcousticScene(
  x,
  freqMap,
  typeCol = "species",
  title = NULL,
  bin = "1day",
  scale = c("log", "linear"),
  freqMin = NULL,
  alpha = 1
)

Arguments

x

dataframe of detections, must have column UTC and a column to connect detection types to the frequency type map

freqMap

a dataframe listing frequency ranges to use for various detection types in x. Must have columns type, freqMin (Hz), freqMax (Hz), and optionally color (color to use for this type of detection on plot)

typeCol

column name in x that matches names in type column in freqMap

title

optional title to use for the plot

bin

time bin to use for plotting time axis. Each detection will be displayed as covering this amount of time

scale

one of log or linear, the frequency scale for the plot

freqMin

optional minimum frequency for plot, useful for log scale

alpha

transparency percentage for plotting, values less than 1 will allow multiple overlapping colors to be seen

Value

a ggplot object

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples

detDf <- data.frame(
   UTC=as.POSIXct(c('2023-01-01 00:00:00',
                    '2023-01-03 00:00:00',
                    '2023-01-02 12:00:00',
                    '2023-01-04 00:00:00'),
                  tz='UTC'),
  species = c('Dolphin', 'Whale', 'Whale', 'Dolphin'))
freqMap <- data.frame(type=c('Dolphin', 'Whale'),
                      freqMin=c(10e3, 100),
                      freqMax=c(30e3, 400),
                      color=c('darkgreen', 'blue'))
plotAcousticScene(detDf, freqMap=freqMap, typeCol='species', bin='1day')


[Package PAMscapes version 0.5.3 Index]