Dear R Users

I have a problem to understand the loop merge in RSAGA

I have this file (not order name)
DEM2644147
DEM2644148
DEM2644149
DEM2744150
DEM2744155
DEM2744168

I did a file list in CSV:

path<- ("C:/mydata/")
temp  <- paste(path,"input.csv", sep="")
input  <- read.csv(temp, header = TRUE)
attach(input)
names(input)
temp <- file
file.list <- as.list(temp)


# USE POWER TO DEM
power <- seq(1.0, 10.0, by=0.1)

# power of DCM
for(i in 1:length(file.list)){
for (method in 1:length(power)){
      rsaga.grid.calculus(in.grids = c(paste("C:/mydata/DEM",
file.list[[i]],".sgrd", sep="")),
           out.grid =
c(paste("C:/mydata/Power_DEM",file.list[[i]],"_",method+9,".sgrd",sep="")),
           formula = paste("a^",power[method],sep=""))
}
}

#TRY with two DEM with power^1
rsaga.geoprocessor(lib="grid_tools", module=3,
param=list(GRIDS="C:/mydata/Power_DEM2644147_10.sgrd;C:/mydata/Power_DEM2644148_10.sgrd",
MERGED="C:/mydata/merge_power10.sgrd",TYPE=6,INTERPOL=0,OVERLAP=0))

Now I am trying to merge in a LOOP every DEM to have:
all_merge_power10
all_merge_power11
all_merge_power12
all_merge_power13
etc


for(i in 1:length(file.list)){
for (method in 1:length(power)){
rsaga.geoprocessor(lib="grid_tools", module=3,
   param=list(GRIDS=c(paste("C:/mydata/Power_DEM",file.list[[i]],"method+9",".sgrd",sep="")),
   MERGED="C:/mydata/all_merge_power10.sgrd",
   TYPE=6,
   INTERPOL=0,
   OVERLAP=0))
}
}



I have diffucult to load all DEM power 10, ect etc and every time I have a
Error :-(.

Thanks a lot

Gianni

	[[alternative HTML version deleted]]

