spectrogram: Computes spectrogram

Description Usage Arguments Details Value References See Also Examples

View source: R/spectrogram.R

Description

This function builds spectrogram, using CWT, for each individual of a behavr table

Usage

1
2
spectrogram(var, data, period_range = c(hours(16), hours(32)),
  resample_rate = 1/mins(15), FUN = cwt_spectrogram, ...)

Arguments

var

variable to analyse

data

behavr table

period_range

vector of size 2 defining minimal and maximal range of period to study (in seconds)

resample_rate

frequency to resample (up or down) the data at (in hertz)

FUN

function used to compute spectrograms (so far, only CWT is implemented via cwt_spectrogram)

...

additional arguments to be passed to FUN

Details

A spectrogram is a estimation of the local periodicity of a signal at a given time. In the context of circadian rhythm, it can be useful to understand how infradian rhythms change along the day or, for instance, how circadian rhythm change ver the course of an multi-day experiment.

Value

A behavr::behavr table. In addition to the metadata, it contains data that encodes a spectrogram (i.e. power vs period). The data contains the columns:

References

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(dams_sample)
dt <- dams_sample[id %in% dams_sample[meta=TRUE, ,id[1:5]]]
spect_dt <- spectrogram(activity, dt)


require(ggetho)
ggspectro(spect_dt) +
        stat_tile_etho() +
        scale_y_log10() +
        facet_wrap(~ id)

zeitgebr documentation built on April 25, 2020, 5:07 p.m.