View source: R/animation_functions.R
mocap_plot_basic | R Documentation |
mocap_plot_basic
is caled by the functions animate_global
, animate_anatomical
, and animate_movement
functions
to set up the basic structure of the plots and animations
mocap_plot_basic(
.data,
planes = c("R", "F"),
planes_in_rows_or_cols = c("cols"),
row_facets = NULL,
col_facets = NULL,
subject = NULL,
remove_facet_labels = TRUE,
remove_grid = TRUE
)
.data |
A tibble containg mocap data in the mocapr format. |
planes |
What planes should be included in the final plot/animation? defaults to c("R", "F"), use c("X", "Z") if you are using global coordinates. |
planes_in_rows_or_cols |
Facet the chosen planes in either rows or columns. Must be one of c("rows", "cols"). Defaults to "cols". |
row_facets |
Make additional row-facets in the animation using a given variable. Defaults to NULL. |
col_facets |
Make additional column-facets in the animation using a given variable. Defaults to NULL. |
subject |
Column that contains subject ID. Is only needed if more than one subject is present in the same frame. |
remove_facet_labels |
Remove the facet labels. Defaults to |
remove_grid |
Remove the grid lines. Defaults to |
a ggplot2 object
df <- dplyr::filter(mocapr::mocapr_data, movement_nr == 1)
df <- dplyr::filter(df, frame %in% c(1, 50, 75, 100))
df <- mocapr::animate_global(df,
return_data = TRUE)
mocap_plot_basic(df,
planes = c("X", "Y"), # Because the data comes from animate_global()
planes_in_rows_or_cols = "rows",
col_facets = frame)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.