View source: R/op_compute_jerk.R
op_compute_jerk | R Documentation |
This function calculates the jerk for each column that begins with 'x' and 'y' and removes all columns that start with 'c'. It takes either the fps or the video duration as input to compute the jerk.
op_compute_jerk(
data,
fps = NULL,
video_duration = NULL,
overwrite = FALSE,
merge_xy = FALSE
)
data |
A data frame containing the columns to process. |
fps |
Frames per second, used to compute jerk. |
video_duration |
Video duration in seconds, used to compute fps. |
overwrite |
Logical value indicating whether to remove original 'x' and 'y' columns. |
merge_xy |
Logical value indicating whether to merge x and y columns using Euclidean distance. |
A data frame with jerk columns added and 'c' columns removed.
# Load example data from the package
data_path <- system.file("extdata/csv_data/A-B_body_dyad_accel.csv", package = "duet")
data <- read.csv(data_path)
# Compute jerk
result <- op_compute_jerk(
data = data,
fps = 30,
overwrite = FALSE,
merge_xy = TRUE
)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.