View source: R/squat_functions.R
add_squat_events | R Documentation |
add_squat_events()
takes a tibble as the only argument, and returns the tible with three extra columns useful for further analysis.
The three extra columns are: "squat_events", "phase", and "squat_depth".
The tibble must contain motioncapture data with the columns frame
, LHY
, and RHY
and the captured motion must be a squat. Please note that the function will not fail if the movement is not a squat.
add_squat_events(.data)
.data |
A tibble containing motioncapture data from a squat and the columns |
A tibble with three added columns. squat_events
, phase
, and squat_depth
. squat_depth
is given in cm.
# Prepare data
df <- dplyr::filter(mocapr::mocapr_data, movement_nr == 1, frame > 20, frame < 70)
df <- dplyr::select(df, frame, LHY, RHY)
add_squat_events(df)
df2 <- data.frame(
frame = seq(1:11),
LHY = c(100, 95, 90, 85, 80, 75, 70, 65, 60, 80, 100),
RHY = c(100, 95, 90, 85, 80, 75, 70, 65, 60, 80, 100))
add_squat_events(df2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.