r - Using Rscript to create graphs from command line -


is possible generate pdfs/pngs of graphs directly command line using r?

i attempted command:

rscript -e 'pdf(\'graph.pdf\');plot(c(1,2,3,4,5));dev.off()' 

which executes, no file generated.

works here:

edd@max:~$ mkdir /tmp/demo edd@max:~$ cd /tmp/demo edd@max:/tmp/demo$ rscript -e 'pdf("foo.pdf"); \                                plot(cumsum(rnorm(100)), type="l"); \                                dev.off()' null device            1  edd@max:/tmp/demo$ ls -l total 8 -rw-rw-r-- 1 edd edd 5132 sep 12 19:36 foo.pdf edd@max:/tmp/demo$  

the chart (converted png inclusion here) below.

enter image description here


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -