[R-sig-Geo] Passing a parameter from R to r.mapcalc ?

Agustin Lobo aloboaleu at gmail.com
Tue Jan 20 19:07:21 CET 2009


Hi!

I have an script in R that mostly controls the
flow of grass commands through system()
I've got stuck at:

for (k in mistat[,1]){
		system("r.mapcalc 'mancha = if(manchas.clmp==k,1,0)'")


is there any way I could pass the value of k to r.mapcalc?
I was thinking on using the shell through system, something like
for (k in mistat[,1]){
		system("set k = @1")
		system("r.mapcalc 'mancha = if(manchas.clmp==$k,1,0)'")

but do not get thru,
(perhaps I'm mixing my memories of the csh and the Bourne shell...)

any help?

Agus

-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster




More information about the R-sig-Geo mailing list