R equivalent to handy dev.copy2pdf, but for dev.copy2svg?

I found a very handy dev.copy2pdf command to copy the window that I am viewing into a PDF file like so:

plot(rnorm(1000))
dev.copy2pdf(file="myfile.pdf")

      

And my question is, is there an equivalent dev.copy2svg

for the same effect, but which is written to svg format?

+3


source to share


1 answer


In fact, it dev.copy2pdf

is a convenient wrapper around a common function dev.copy

. You can use it to copy to SVG device like:



plot(rnorm(1000))
dev.copy(svg, file="myfile.svg")
dev.off()

      

+5


source







All Articles