How to use the function `rstudioapi::savePlotAsImage`

Just as a note, since reprex uses rmarkdown/knitr to run your code in a separate, non-interactive R session, functions from rstudioapi are not going to work (as far as the reprex session is concerned, RStudio is not running). This is one of the few situations where unfortunately, using reprex creates confusion rather than clarity!

For more info, see:

and also:

https://support.rstudio.com/hc/en-us/community/posts/203910987-versionInfo-not-working

1 Like