Re: [R] paste? 'cmd /c "c:\\pheno\\whap --file c:\\pheno\\smri --alt 1"'

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 25 Sep 2006 - 20:45:23 GMT

Use single outer quotes so that the inner double quotes are not interpreted as the end of the string.

cmd <- 'cmd /c "...whatever..." '
system(cmd, intern = TRUE)

On 9/25/06, Boks, M.P.M. <M.P.M.Boks@umcutrecht.nl> wrote:
> Dear R users,
>
> This command works (calling a programm -called whap- with file specifiers etc.):
>
> >system('cmd /c "c:\\pheno\\whap --file c:\\pheno\\smri --alt 1 --perm 500"', intern=TRUE)
>
> Now I need to call it from a loop to replace the "1" by different number, however I get lost using the quotes:
>
> I tried numerous versions of:
>
> >i<-1
> >system(paste(c("'cmd /c "c:\\pheno\\whap --file c:\\pheno\\smri --alt", i, " --perm 500"'", sep="" )), intern=TRUE)
>
> However no luck! I would be gratefull for any help.
>
> Thanks,
>
> Marco
>
> ______________________________________________
> 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.
>



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. Received on Tue Sep 26 06:49:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 25 Sep 2006 - 21:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.