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.
Comments
Post a Comment