periodogram | R Documentation |
This function builds periodograms, with one of several methods, for each individual of a behavr table
periodogram(var, data, period_range = c(hours(16), hours(32)),
resample_rate = 1/mins(15), alpha = 0.01, FUN = chi_sq_periodogram,
...)
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) |
alpha |
significance level |
FUN |
function used to compute periodogram (see periodogram_methods) |
... |
additional arguments to be passed to FUN |
A behavr::behavr table. In addition to the metadata, it contains data that encodes a periodogram (i.e. power vs period). The data contains the columns:
power
– the power the or equivalent (according to FUN
)
period
– the period at which power
is computed (in seconds)
p_value
– the p value associated to the power estimation
signif threshold
– the threshold above which power is considered significant
zeitgebr tutorial – the relevant rehtomics tutorial
periodogram_methods – the list of built-in methods
find_peaks – to find peaks in the periodogram
ggetho::ggperio – to plot periodograms
data(dams_sample)
# only a half of the individuals for the sake of the example
dt <- dams_sample[xmv(region_id) %in% (1:16 * 2)]
pdt <- periodogram(activity, dt, FUN = ls_periodogram, oversampling = 4)
pdt <- periodogram(activity, dt, FUN = chi_sq_periodogram)
require(ggetho)
ggperio(pdt, aes(colour=period_group)) + stat_pop_etho()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.