View source: R/general__functions.R
swap_axis | R Documentation |
Swaps column name suffixes, typically used for motion capture axes (e.g., X <-> Z).
swap_axis(df, axis1, axis2)
df |
A data frame or tibble with column names ending in axis suffixes. |
axis1 |
A string. First axis suffix to swap (e.g., "X"). |
axis2 |
A string. Second axis suffix to swap (e.g., "Z"). |
A tibble with renamed columns.
# df <- tibble("LHX" = 1, "LHZ" = 2)
# swap_axis(df, "X", "Z")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.