Ronaldo Reis Junior
2007-Aug-24 10:58 UTC
[R] It is possible to use a Shell command inside a R script?
Hi, 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? Thanks Ronaldo -- Acalme-se, s??o somente 0's e 1's --> Prof. Ronaldo Reis J?nior| .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Ecologia | : :' : Campus Universit?rio Prof. Darcy Ribeiro, Vila Mauric?ia | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil | `- Fone: (38) 3229-8187 | ronaldo.reis em unimontes.br | chrysopa em gmail.com | http://www.ppgcb.unimontes.br/ | ICQ#: 5692561 | LinuxUser#: 205366
Henrique Dallazuanna
2007-Aug-24 12:02 UTC
[R] It is possible to use a Shell command inside a R script?
Hi, see ?system -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 24/08/07, Ronaldo Reis Junior <chrysopa@gmail.com> wrote:> > Hi, > > 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? > > Thanks > Ronaldo > -- > Acalme-se, são somente 0's e 1's > -- > > Prof. Ronaldo Reis Júnior > | .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Ecologia > | : :' : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia > | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil > | `- Fone: (38) 3229-8187 | ronaldo.reis@unimontes.br | > chrysopa@gmail.com > | http://www.ppgcb.unimontes.br/ | ICQ#: 5692561 | LinuxUser#: 205366 > > ______________________________________________ > R-help@stat.math.ethz.ch 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. >[[alternative HTML version deleted]]
Alberto Monteiro
2007-Aug-24 12:05 UTC
[R] It is possible to use a Shell command inside a R script?
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
Duncan Murdoch
2007-Aug-24 12:32 UTC
[R] It is possible to use a Shell command inside a R script?
On 8/24/2007 6:58 AM, Ronaldo Reis Junior wrote:> Hi, > > 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.The details and available functions depend on the platform, but you want to look at ?system, ?shell, and/or ?shell.exec. (These all exist in Windows; on Unix-alikes, you probably won't have the latter two.) Duncan Murdoch