
Combine multiple days for one animal with pagination
Source:R/viz_combine_plots.R
combine_animal_plots.Rd
Takes plots for multiple days of one animal and creates paginated plots with a user-defined number of plots per page to avoid overcrowding.
Usage
combine_animal_plots(
plot_list,
animal_id,
plots_per_page = 4,
method = c("vertical", "grid"),
title_prefix = NULL
)
Arguments
- plot_list
Nested list of plots from
viz_meal_clusters()
- animal_id
Character or numeric. Animal ID to combine plots for
- plots_per_page
Integer. Number of plots to include per page (default: 4)
- method
Character. Method for combining plots: "vertical" or "grid" (default: "vertical")
- title_prefix
Character. Prefix for page titles (default: NULL)
Examples
toy_data <- all_fed[[1]][which(all_fed[[1]]$cow %in% c(5114, 4070, 7010, 5028, 6020, 6030)),]
labeled <- meal_label_visits(toy_data, id_col = 'cow', start_col = 'start',
end_col = 'end', bin_col = 'bin', intake_col = 'intake', dur_col = 'duration',
tz = 'America/Vancouver')
# Customize colors and text
p <- viz_meal_clusters(labeled, id_col = 'cow', start_col = 'start')
combined_plot <- combine_animal_plots(p, animal_id = "5114")