ggspectro: Prepare a ggplot object to represent spectrogram data

Description Usage Arguments Value References See Also Examples

View source: R/ggspectro.R

Description

This function summarises spectrogram data (containing spectrograms of multiple individual), to show period on the y axis, time on the x axis and power on the z axis (e.g. as a colour).

Usage

1
2
3
ggspectro(data, mapping = aes(), summary_FUN = mean,
  summary_time_window = mins(30), time_wrap = NULL, time_offset = 0,
  ...)

Arguments

data

behavr::behavr table containing the data and metadata

mapping

default list of aesthetic mappings to use for plot

summary_FUN

method (function) used to summarise variable over time (typically, the mean)

summary_time_window

width (in seconds) of the time window to compute a summary on

time_wrap

time (in seconds) used to wrap the data (see details)

time_offset

time offset (i.e. phase, in seconds) when using time_wrap

...

additional arguments to be passed to ggplot2::ggplot()

Value

An initial ggplot object that can be further edited.

References

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(zeitgebr)
data(dams_sample)
dt <- dams_sample
spect_dt <- spectrogram(activity, dt)
pl <- ggspectro(spect_dt,time_wrap = hours(24)) +
  stat_tile_etho() +
  scale_y_hours(log=TRUE) +
  stat_ld_annotations(ld_colours = c("grey","black"))
pl + facet_grid(period_group ~ .)
pl + facet_wrap(~ id)

ggetho documentation built on April 30, 2020, 1:06 a.m.