spectrogram | R Documentation |
This function builds spectrogram, using CWT, for each individual of a behavr table
spectrogram(var, data, period_range = c(hours(16), hours(32)),
resample_rate = 1/mins(15), FUN = cwt_spectrogram, ...)
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 |
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.
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:
t
– the time (in s) (same range the input time)
period
– the period at which the power
is computed, for a given t
(in s)
power
– the power the or equivalent (according to FUN
)
ridge
– a logical defining whether the point (t
and period
) is a ridge
spectrogram tutorial – the relevant rehtomics tutorial
periodogram – to compute periodogram instead
cwt_spectrogram – The dunction use to compute individual spectrograms
ggetho::ggspectro – to plot spectrograms
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.