[R] It is possible to use a Shell command inside a R script?

Alberto Monteiro albmont at centroin.com.br
Fri Aug 24 14:05:31 CEST 2007


Ronaldo Reis Junior wrote:
> 
> It is possible to use a shell command inside a R script?
> 
> I'm write a R script and I like to put somes shell commands inside 
> to R. Somethink like: convert fig01.png fig01.xpm or sed ..., etc.
> 
> It is possible? How?
> 
?system

BTW, I found that using things directly in R is _much_
slower than creating a batch file and then running it.

For example, I had a directory with misnamed mp3 files,
and I wanted to use R to rename and copy them
to another directory. I tried to use file.copy, but it 
took too much time. Writing a batch file and then running
it was much faster.

Alberto Monteiro



More information about the R-help mailing list