Is there a way to get R / RStudio to copy a plot to the clipboard with a custom size?
RStudio has this function, but you have to define the size everytime and there is some extra clicking which I am sure is avoidable.
I tried my best with saving as jpeg or else with file="clipboard"
and then - after plotting - dev.off()
. No error messages, but also nothing in the clipboard.
Here is an example:
data(mtcars)
jpeg(file = "clipboard",width = 800, height = 600, units = "px", pointsize = 12,
quality = 100,
bg = "white", res = NA, family = "", restoreConsole = T)
hist(mtcars$mpg)
dev.off()
Any ideas on how this can be achieved?