Skip to contents

Multiply instantaneous position by -1.

Usage

invert_position(x)

Arguments

x

A muscle_stim object

Value

A workloop object with inverted position. The position_inverted attribute is set to TRUE and all others are retained.

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 a column entitled Position. Other columns and attributes are welcome and will be passed along unchanged.

See also

Other data transformations: fix_GR(), select_cycles()

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

Other twitch functions: fix_GR(), isometric_timing()

Other tetanus functions: fix_GR()

Author

Vikram B. Baliga

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)

# invert the sign of Position
wl_fixed <- invert_position(wl_dat)

# quick check:
max(wl_fixed$Position) / min(wl_dat$Position) # -1
#> [1] -1