This function reads a C3D file, extracts EMG data, and optionally writes it to a .sto file and/or returns the data as a data frame.
Usage
get_EMG_c3d_osim(
file_input,
file_output = "EMG_RAW.sto",
columns_exclude = c(1L:40L),
EMG_names = c("Voltage.1", "Voltage.2", "Voltage.3", "Voltage.4", "Voltage.6",
"Voltage.7", "Voltage.8", "Voltage.9", "Voltage.10", "Voltage.12", "Voltage.13",
"Voltage.14", "Voltage.15", "Voltage.16"),
Muscle_names = c("vaslat_r", "recfem_r", "vasmed_r", "vasmed_l", "vaslat_l", "tfl_r",
"tfl_l", "bflh_l", "semiten_l", "semiten_r", "bflh_r", "gaslat_l", "gasmed_r",
"gaslat_r"),
write_file = TRUE,
return_object = FALSE
)
Arguments
- file_input
A string specifying the path to the input C3D file.
- file_output
A string specifying the path for the output .sto file (default is "EMG_RAW.sto").
- columns_exclude
A numeric vector of indices for columns to exclude from the EMG data.
- EMG_names
A character vector specifying the names of the EMG channels to extract (default includes "Voltage.1" to "Voltage.16").
- Muscle_names
A character vector specifying the muscle names corresponding to the EMG data (default provided).
- write_file
A logical value indicating whether to write the output to a file (default is TRUE).
- return_object
A logical value indicating whether to return the EMG data as a data frame (default is FALSE).