[R-sig-Geo] paste(" /" ") and paste(" /' ") for grass command

Agustin Lobo alobolistas at gmail.com
Wed Apr 22 10:31:55 CEST 2009


I wish to write  "" using paste(), but

> paste("\"","Hola","\"",sep="")
[1] "\"Hola\""
>

while the same approach works with ''
> paste("\'","Hola","\'",sep="")
[1] "'Hola'"

why this difference? how could I do it to get "Hola" ?

I need this to write this string in R:
v.extract codigo_Montseny07_clump out=extract11917 where="(GRIDCODE = 
11917)"

and pass it to grass. Something like:
for (i in polis){
    system("g.region vect=codigo_Montseny07_clump")
    nomextract <- paste("extract",i,sep="")
    grcomm <- paste("v.extract codigo_Montseny07_clump out=",nomextract, 
" where=\"(GRIDCODE = ",i,")\" ",sep="")
    system(grcomm)

...

Thanks

Agus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alobolistas.vcf
Type: text/x-vcard
Size: 251 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090422/f11fa9e9/attachment.vcf>


More information about the R-sig-Geo mailing list