Hi
I have a dataset that I want to go through printing multiple graphs: df <- structure(list(run = c("Shakedown", "Shakedown", "Shakedown", "Shakedown - Pastebin.com
I'm using purrr to map my graph function to each nested grouping and can therefore print out all my graphs, but I would like to title each one by what they were grouped by so I can tell them apart
Thanks
my_graphs <- df %>%
pivot_longer(names_to = "name", values_to = "value", cols = viability_percent:vcd_10_5_cells_m_l) %>%
group_by(grouping, name) %>%
nest() %>%
mutate(graphs = map(
data,
function(.x) {
ggplot(.x, aes(actual_duration_of_subculture_hrs, value, group = run)) +
geom_point() +
geom_line()
}
))
my_graphs$graphs %>%
map(print)