spectrogram | R Documentation |
spectrogram()
computes a series of Sokolove & Bushell's (1978)
\chi^{2}
periodograms with the purpose of visualize
differences in periodicities in a given interval of a
tsibble
object.
See ?periodogram to learn more about the periodogram computation.
spectrogram(
data,
col,
p_unit = "minutes",
p_min = 1000,
p_max = 2500,
p_step = 1,
int_unit = "days",
int_n = 7,
int_step = 720,
alpha = 0.05,
print = TRUE
)
data |
A |
col |
A string indicating which column of |
p_unit |
(optional) a string indicating at which time unit the index
must be aggregated. By aggregating the index, this will change the time
series interval and, consequently, its |
p_min |
(optional) an integer number indicating the minimum period
( |
p_max |
(optional) an integer number indicating the maximum period
( |
p_step |
(optional) an integer number indicating the range of values
that must be skipped between computing one test and the next (e.g., when
|
int_unit |
(optional) a string indicating the interval unit. Valid
values are: |
int_n |
(optional) an integer number indicating the size of the
intervals, with the same unit as |
int_step |
(optional) an integer number indicating the amount of epochs
to advance at the end of each interval (default: |
alpha |
(optional) a number, from |
print |
(optional) a |
A list
object with the following elements:
periodograms
: a list
object with the periodogram data for
each interval. See ?periodogram()
to learn more about the
list elements.
spectrogram
: a ggplot
object with a heat map chart
showing one periodogram per line (q_p
)(y) by the period sequence (p_seq
)
(x).
Sokolove, P. G., & Bushell, W. N. (1978). The chi square periodogram: its utility for analysis of circadian rhythms. Journal of Theoretical Biology, 72(1), 131-160. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0022-5193(78)90022-x")}.
Other period analysis functions:
periodogram()
## Not run:
if (requireNamespace("curl", quietly = TRUE) &&
requireNamespace("jsonlite", quietly = TRUE) &&
requireNamespace("tools", quietly = TRUE)) {
if (curl::has_internet()) {
file <- get_from_zenodo(
doi = "10.5281/zenodo.4898822", path = tempdir(),
file = "processed.txt"
)
data <- read_acttrust(file, tz = "America/Sao_Paulo")
spec <- spectrogram(data, "pim")
}
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.