See example below. Any suggestions?
library(patchwork)
make_plot <- function() {
hc <- hclust(dist(USArrests), "ave")
patchwork::wrap_elements(~ plot(hc))
}
plot_list <- list()
plot_list[[1]] <- make_plot()
patchwork::wrap_plots(plot_list, ncol = 1)
Output:
Error in plot(hc) : object 'hc' not found
See example below. Any suggestions?
Output: