View source: R/plotAcousticScene.R
plotAcousticScene | R Documentation |
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
plotAcousticScene(
x,
freqMap = NULL,
typeCol = "species",
title = NULL,
bin = "1day",
by = NULL,
combineYears = FALSE,
effort = NULL,
scale = c("log", "linear"),
freqMin = NULL,
freqMax = NULL,
fill = TRUE,
alpha = 1,
returnData = FALSE,
add = FALSE
)
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 |
by |
if not |
combineYears |
logical flag to combine all observations to display as a single "year". The year will be set to 2019, and detections falling on leap days (February 29th) will be removed |
effort |
if not |
scale |
one of |
freqMin |
optional minimum frequency for plot, useful for log scale |
freqMax |
optional maximum frequency for plot |
fill |
logical flag if |
alpha |
transparency percentage for plotting, values less than 1 will allow multiple overlapping colors to be seen |
returnData |
if |
add |
logical flag if |
a ggplot object
Taiki Sakai taiki.sakai@noaa.gov
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.