Repairs marker trajectories by swapping the data columns of detected swap pairs from the swap frame onward.
Arguments
- pe
A PhysioExperiment with position assays.
- swaps
A
data.frameas returned bydetectSwaps(), containing at minimumframe,marker_a,marker_b, andconfidencecolumns.- assay_prefix
Prefix for position assay names. Default
"position".- min_confidence
Minimum confidence threshold for applying a correction. Swaps below this threshold are skipped. Default 0.5.
Examples
demo <- demoMoCapData(seed = 1)
swaps <- detectSwaps(demo$mocap)
pe_fixed <- correctSwaps(demo$mocap, swaps)
pe_fixed
#> class: PhysioExperiment
#> dim: 300 x 8
#> assays(3): position_x, position_y, position_z
#> samplingRate: 120 Hz
#> channels(8): Pelvis_R, Pelvis_L, Knee_R, Knee_L, Ankle_R ...
#> colData names(2): label, type