plotLTSA {PAMscapes}R Documentation

Plot Long-Term Spectral Average (LTSA)

Description

Creates a long-term spectral average (LTSA) style plot of the data, a plot where the x-axis is time and the y-axis is frequency. Color represents the magnitude of sound. In order to compress the time axis, data are binned into time chunks and the median value within that time bin is displayed

Usage

plotLTSA(
  x,
  bin = "1hour",
  scale = c("log", "linear"),
  title = NULL,
  freqRange = NULL,
  dbRange = NULL,
  units = NULL,
  cmap = viridis_pal()(25),
  toTz = "UTC"
)

Arguments

x

a soundscape metric file that can be read in with checkSoundscapeInput, or a dataframe with UTC, frequency, and value

bin

amount of time to bin for each LTSA slice, format can be "#Unit" e.g. '2hour' or '1day'

scale

scaling for frequency axis, one of log or linear

title

optional title for plot

freqRange

if not NULL, a vector of two numbers specifying the range of frequencies (Hz) to plot. Providing NA for either value will use the max/min frequency present in the dataset

dbRange

if not NULL, a fixed limit to use for the color scaling of dB values in the plot

units

units for plot labeling, will attempt to read them from the input

cmap

color palette map to use for plot, default is viridis_pal

toTz

timezone to use for the time axis (input data must be UTC). Specification must be from OlsonNames

Value

ggplot object of the LTSA plot

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples

hmd <- checkSoundscapeInput(system.file('extdata/MANTAExampleSmall1.csv', package='PAMscapes'))
# time range is too small for nice plots
plotLTSA(hmd, bin='1min', title='Every Minute')
plotLTSA(hmd, bin='2min', title='2 Minute Bins')



[Package PAMscapes version 0.6.0 Index]