Hi all and thanks for attention.
I have to raster DCM_1.sgrd and DCM_2.sgrd. I wish to elevate to power of 1.5 to 4 both rasters. When I use this code I have this problem: for(method in 1:2) { power<- seq(1.5, 4.0, by=0.1) for (i in 1:length(power)){ rsaga.grid.calculus(in.grids = c(paste("DCM_", method, ".sgrd", sep=""))), out.grid = paste("DCM_",method,"_power", i+14,".sgrd",sep=""), #A# 14=[(40-15)-1] formula = paste("a^",power[i],sep="")) }} > for(method in 1:2) { + power<- seq(1.5, 4.0, by=0.1) + for (i in 1:length(power)){ + rsaga.grid.calculus(in.grids = c(paste("DCM_", method, ".sgrd", sep=""))), Error: unexpected ',' in: "for (i in 1:length(power)){ rsaga.grid.calculus(in.grids = c(paste("DCM_", method, ".sgrd", sep="")))," > out.grid = paste("DCM_",method,"_power", i+14,".sgrd",sep=""), #A# 14=[(40-15)-1] Error: unexpected ',' in " out.grid = paste("DCM_",method,"_power", i+14,".sgrd",sep="")," > formula = paste("a^",power[i],sep="")) }} Error: unexpected ')' in " formula = paste("a^",power[i],sep=""))" I try all my morning to understand the problem but nothing Ale [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo