fix_GR {workloopR}R Documentation

Adjust for the gear ratio of a motor arm

Description

Fix a discrepancy between the gear ratio of the motor arm used and the gear ratio recorded by software.

Usage

fix_GR(x, GR = 1)

Arguments

x

A muscle_stim object

GR

Gear ratio, set to 1 by default

Details

The muscle_stim object can be of any type, including workloop, twitch, or tetanus.

If you have manually constructed the object via as_muscle_stim(), the muscle_stim object should have columns as follows:
Position: length change of the muscle;
Force: force

Value

An object of the same class(es) as the input (x). The function will multiply Position by (1/GR) and multiply Force by GR, returning an object with new values in $Position and $Force. Other columns and attributes are welcome and will simply be passed on unchanged into the resulting object.

Author(s)

Vikram B. Baliga

See Also

analyze_workloop, read_analyze_wl, read_analyze_wl_dir

Other data transformations: invert_position(), select_cycles()

Other workloop functions: analyze_workloop(), get_wl_metadata(), invert_position(), read_analyze_wl_dir(), read_analyze_wl(), select_cycles(), summarize_wl_trials(), time_correct()

Other twitch functions: invert_position(), isometric_timing()

Other tetanus functions: invert_position()

Examples


library(workloopR)

# import the workloop.ddf file included in workloopR
wl_dat <-read_ddf(system.file("extdata", "workloop.ddf",
                              package = 'workloopR'),
                  phase_from_peak = TRUE)

# apply a gear ratio correction of 2
# this will multiply Force by 2 and divide Position by 2
wl_fixed <- fix_GR(wl_dat, GR = 2)

# quick check:
max(wl_fixed$Force) / max(wl_dat$Force) # 5592.578 / 2796.289 = 2
max(wl_fixed$Position) / max(wl_dat$Position) # 1.832262 / 3.664524 = 0.5


[Package workloopR version 1.1.4 Index]