[R] how to run a linux syntax within an R script?
Christian Salas
christian.salas at yale.edu
Mon Nov 12 03:43:17 CET 2007
thanks,
I got it!
-------------------------------------------------------------------------------
Christian Salas E-mail:christian.salas at yale.edu
PhD student http://environment.yale.edu/salas
School of Forestry & Environmental Studies Tel: +1-(203)-432 5126
Yale University Fax:+1-(203)-432 3809
360 Prospect St Office: Room 35, Marsh Hall
New Haven, CT 06511-2189
USA
Yale Biometrics Laboratory http://environment.yale.edu/biometrics/
-------------------------------------------------------------------------------
Rolf Turner wrote:
>
> ?system
>
> On 12/11/2007, at 2:28 PM, Christian Salas wrote:
>
>> Is it possible to run a linux syntax (i.e. like i was at a linux
>> terminal) from an R code?
>>
>> Just one example:
>> Let say that I have an R code with
>>
>> hist(rnorm(100))
>> dev.copy2eps(file="Dnormal.eps")
>>
>> and then within the same R code, i want to convert the file
>> 'Dnormal.eps' to 'Dnormal.pdf'. This can be achieved using at the linux
>> terminal
>> %epstopdf Dnormal.eps
>>
>> but i do not know how to include this within the R script, any ideas?
>>
>> I know that i can also save the plot (within R) using pdf(), but I want
>> to save the same plot as eps and pdf, without having to reproduce the
>> code for the plot (in this case the plot is easy, but not always is like
>> that)
>>
>> I want to do this to compile later a document using pdflatex (uses pdf
>> figures) or latex (uses eps figures). Again, I know that i can also
>> compile (in latex) the document to dvi, and then to ps, and then to pdf,
>> with this i do not need pdf figures, but i prefer to use pdflatex
>> sometimes.
>>
>>
>> Thanks for the help
>>
>> christian
>>
>> Ps; Operative system used: Linux (Ubuntu-linux 7.10)
>> R operative system: linux-gnu
>> R version: R version 2.5.1 (2007-06-27)
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
> ######################################################################
> Attention:This e-mail message is privileged and confidential. If you are
> not theintended recipient please delete the message and notify the
> sender.Any views or opinions presented are solely those of the author.
>
> This e-mail has been scanned and cleared by
> MailMarshalwww.marshalsoftware.com
> ######################################################################
More information about the R-help
mailing list