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,
freqMax = NULL,
alpha = 1
)
Arguments
x |
dataframe of detections, must have column |
freqMap |
a dataframe listing frequency ranges to use for
various detection types in |
typeCol |
column name in |
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 |
freqMin |
optional minimum frequency for plot, useful for log scale |
freqMax |
optional maximum frequency for plot |
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')