fix_zeros | R Documentation |
Fix Zeros from Idle Sleep Mode
fix_zeros(df, fill_in = TRUE, by_second = FALSE, trim = FALSE)
idle_na_locf(df, by_second = FALSE)
df |
An object with columns 'X', 'Y', and 'Z' or an object of class 'AccData' |
fill_in |
Should the zeros be filled in with the last observation carried forward? |
by_second |
Should the last observation carried forward be done only within the same second? |
trim |
Should the time course be trimmed for zero values at the beginning and the end of the time course? |
A data set with the zeros filled in
df = data.frame(
X = c(0.3/sqrt(0.5), rep(0, 3)),
Y = c(0.4/sqrt(0.5), rep(0, 3)),
Z = c(0.5/sqrt(0.5), rep(0, 3)),
stringsAsFactors = FALSE)
fix_zeros(df)
fix_zeros(df, fill_in = FALSE)
fix_zeros(df, trim = TRUE)
df$time = c(1,3,2, 4)
fix_zeros(df)
acc = list(header = NULL,
data = df
)
class(acc) = "AccData"
idle_na_locf(acc)
fix_zeros(acc, trim = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.