Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R equivalent of the convenient dev.copy2pdf but for dev.copy2svg?

Tags:

r

svg

I found the very convenient dev.copy2pdf command to copy the window I am viewing into a pdf file like so:

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

And my question: is there an equivalent dev.copy2svg for the same effect but that writes out to svg format?

like image 566
719016 Avatar asked Oct 22 '25 13:10

719016


1 Answers

In fact, dev.copy2pdf is a convenient wrapper around the generic dev.copy function. You can use this one to copy to an SVG device, like this :

plot(rnorm(1000))
dev.copy(svg, file="myfile.svg")
dev.off()
like image 142
juba Avatar answered Oct 24 '25 02:10

juba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!