Skip to content
Prev 5566 / 29559 Next

paste(" /" ") and paste(" /' ") for grass command

Dear Agustin,

I think that using the script paste("\"","Hola","\"",sep="") will do the  
job anyway. Yes, you would get "\"Hola\"" as a result but when you pass  
the script to GRASS the \ symbol will not be considered and so you will  
get the string you are looking for.

a <- "v.extract codigo_Montseny07_clump"
b <- paste("out=extract", 11917, sep="")
c <- paste("(GRIDCODE = ", 11917, ")", sep="")
c <- paste("where=\"", c, "\"",sep="")

string <- paste(a,b,c, sep=" ")
system(string)
[1] "v.extract codigo_Montseny07_clump out=extract11917 where=\"(GRIDCODE  
= 11917)\""

When the command is read in GRASS the \ symbol will mean move to the next  
line in the console.

Best,

Jaime -R


On Wed, 22 Apr 2009 10:31:55 +0200, Agustin Lobo <alobolistas at gmail.com>  
wrote: