Hi. 

 

I am using RSAGA multi.local.function to apply random forest to a series of
grids containing 9 topographic derivatives that were calculated in SAGA.
(trying to produce a soil parent material map). 

 

On one series of grids the calculation works fine, and an output ascii file
is produced. When I tried to run the (same) calculation again on a set of
grids calculated from a different area, I received the following error: 

 

Error in sprintf(fmt, res[k, ]) : invalid format '%.4f'; use format %s for
character objects 

 

Moth sets of  ascii grids were generated using the 'basic terrain analysis'
and 'relative slope position' functions in SAGA gui, but with different
starting dems.

 

Each set only contains grids with the same extent, although the files
generated from the different modules may have different nodata values .. 

 

One of the grid stacks has an irregular shape clipped by a polygon, and this
one runs (file size >25mb) ... 

 

The grid stack that fails has a square extent with no 'nodata' cells and
file size 5mb I have looked closely at the different grids in each set (ie
those that work and those that don't) . The header formats appear identical.
The grids all display correctly in the map window of saga gui. 

 

If I switch to multi.focal.function, everything works (slowly!) 

 

I have gone back to saga and re-exported the original sgrds as asciii and
the problem persists. 

 

Do all grids in multi.local.function need to have the same nodata value?? 

Are there any other restrictions on the characteristics of grids that this
function can use? and might be causing the problem.. 

 

I've used SAGA quite a bit but am new to R.

 

Thanks for anything you can suggest 

 

Chuck 

 

multi.local.function(in.grids =
c("ELEV","SLOPE","AACN","CNBL","SLOPEHT","VALLEYDP","RHSP","MRVBF","MRRTF"),
out.varnames = "pred_kam2", fun = grid.predict, fit = PGMRF, control.predict
= list(type = "response")) 

 

saga 2.08 64 bit 

R version 2.14.1 (2011-12-22) 

windows7


	[[alternative HTML version deleted]]

