Learn R Programming

PAMscapes (version 0.7.0)

plotHourlyLevel: Plot Hourly Sound Level

Description

Plots a heatmap of summarised sound levels. Y-axis is hour of the day, X-axis is frequency bin. Plotted values are the median of the value column for each hour/frequency pairing across the dataset. This function is designed to work with sound level outputs with consistent frequency bins measured across time

Usage

plotHourlyLevel(
  x,
  title = NULL,
  units = NULL,
  scale = c("log", "linear"),
  freqMin = NULL,
  dbRange = NULL,
  toTz = "UTC",
  cmap = viridis_pal()(25),
  returnData = FALSE
)

Value

a ggplot object

Arguments

x

a dataframe with columns UTC, frequency, and value

title

title for the plot. If NULL (default) it will use the first value in the type column of x (if present)

units

name of units for plot labeling, default is taken from common soundscape units

scale

one of 'log' or 'linear' for the scale of the frequency axis

freqMin

minimum frequency for the plot range, if desired to be different than the minimum frequency of the data

dbRange

range of dB values to plot

toTz

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

cmap

color palette map to use for plot, default is viridis_pal

returnData

if TRUE then no plot will be generated, instead the dataframe that would normally be used to make the plot will be returned

Author

Taiki Sakai taiki.sakai@noaa.gov

Examples

Run this code
plotHourlyLevel(system.file('extdata/OLSmall.csv', package='PAMscapes'))

Run the code above in your browser using DataLab