add_squat_events: Divide a squat movement into phases and events

View source: R/squat_functions.R

add_squat_eventsR Documentation

Divide a squat movement into phases and events

Description

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.

Usage

add_squat_events(.data)

Arguments

.data

A tibble containing motioncapture data from a squat and the columns frame, LHY, and RHY.

Value

A tibble with three added columns. squat_events, phase, and squat_depth. squat_depth is given in cm.

Examples

# 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)

steenharsted/mocapr documentation built on Feb. 1, 2024, 1:49 p.m.