View source: R/RAR_SpectrumBands.r
RAR_SpectrumBands | R Documentation |
Calculates area under predicted smoothed power spectrum based on user-specified frequency bands.
RAR_SpectrumBands(rar_spectrum, freq.bands, log_transform = c(TRUE,
FALSE), id_column = NULL)
rar_spectrum |
rar_spectrum default output from RAR_Spectrum(). |
freq.bands |
a matrix of frequency bands, e.g. (t(c(0, 2/24))), ranging between 0 and 60. |
log_transform |
specifies if area should be measured on log or natural scale. If power spectrum was estimated on log scale, this should set to TRUE. Default is TRUE (log scale). |
id_column |
name of column containing id if multiple subjects exist in dataframe. Default is NULL. |
Jessica Graves
data(age_wise)
d <- age_wise[age_wise$id==1,]
rar_ex <- RAR(d, act, date_time, "antilogit")
spec <- RAR_Spectrum(rar_ex, "pss", TRUE)
RAR_SpectrumBands(spec, t(c(0, 2/24)), TRUE)
# Multiple bands
f1 <- c(0, 2/24); f2 <- c(2/24, 25); f3 <- c(25, 60)
fs = as.data.frame(rbind(f1, f2, f3))
RAR_SpectrumBands(spec, fs, TRUE)
# Multiple subjects, multiple bands
d4 <- age_wise[age_wise$id %in% c(1:4), ]
rar_ex4 <- RAR(d4, act, date_time, id_column=id)
spec4 <- RAR_Spectrum(rar_ex4, "pss", TRUE, id)
RAR_SpectrumBands(spec4, fs, TRUE, id) # outputs bands for each participant
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.