periodogram: Computes periodograms

Description Usage Arguments Value References See Also Examples

View source: R/periodogram.R

Description

This function builds periodograms, with one of several methods, for each individual of a behavr table

Usage

1
2
3
periodogram(var, data, period_range = c(hours(16), hours(32)),
  resample_rate = 1/mins(15), alpha = 0.01, FUN = chi_sq_periodogram,
  ...)

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)

alpha

significance level

FUN

function used to compute periodogram (see periodogram_methods)

...

additional arguments to be passed to FUN

Value

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:

References

See Also

Examples

1
2
3
4
5
6
7
8
data(dams_sample)
# only four individuals for the sake of the example
dt <- dams_sample[xmv(region_id) %in% c(1, 7, 21, 31)]
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()

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