Is it possible to parallelise a dplyr::group_walk
operation on grouped data using multidplyr
?
In this first attempt at a general question I won't provide a reprex, but if it helps I can.
I have multiple time series for many individuals and I would like to efficiently produce the plots for each variable for each individual.
My code looks something like this:
time_series_data %>%
group_by(id) %>%
group_walk(~plot_function(.x))
My plot_function()
exports a plot per individual. It works fine but it's long and I have to repeat it for multiple measures (heat, humidity, etc). So I was wondering if there was a way to speed the process using multidplyr
with something that would look like this:
cluster <- new_cluster(6)
time_series_data %>%
group_by(id) %>%
partition(cluster) %>%
group_walk(~plot_function(.x))
Is there a way to do something easy like this to speed up my process?
Thanks in advance for any help :)