View source: R/preprocess_bout.R
| preprocess_bout | R Documentation |
Resample 3-axial input signal to a predefined sampling rate and compute vector magnitude.
preprocess_bout(data, sample_rate = 10L)
preprocess_bout_r(data, sample_rate = 10L)
data |
A |
sample_rate |
sampling frequency, coercible to an integer. This is the sampling rate you're sampling the data into. |
A list of vm_bout, which is an unnamed list of length 2,
containing times and VM (vector magnitude) interpolated. This
will be passed into other forest functions. The list also contains
vm_data, which transforms vm_bout into a data.frame after
creating the required times.
csv_file = system.file("test_data_bout.csv", package = "walking")
if (requireNamespace("readr", quietly = TRUE)) {
x = readr::read_csv(csv_file)
colnames(x)[colnames(x) == "UTC time"] = "time"
if (reticulate::py_module_available("forest")) {
res = preprocess_bout(data = x)
res2 = preprocess_bout_r(data = x)
testthat::expect_equal(res$vm_bout, res2$vm_bout, tolerance = 1e-4)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.