Advice on how to recordPlot() in future_lapply() #720
Answered
by
HenrikBengtsson
leonfodoulian
asked this question in
Q&A
-
Hi, I have a function that silently returns a plot that I would like to save in my output data using Thank you for your advice! Best, |
Beta Was this translation helpful? Give feedback.
Answered by
HenrikBengtsson
Apr 16, 2024
Replies: 1 comment 8 replies
-
Hi, could you please make a minimal example? Are you using base graphics or ggplot2? Also, it might help to know what you want to do with those plots later. Do you want to write them to disk? Or output them in another way? Or modify them before saving them to disk? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Isn't your question the same as when not using Futureverse? If you can figure out how it works when using good old
lapply()
, then I think it'll work also when you usefuture_lapply()
.FWIW, the
R.devices::capturePlot()
is a convenient wrapper aroundrecordPlot()
that you mind find useful. (Yes, I happen to be the author of that one too)