Re: [R-sig-Geo] Using 'raster' package functions with rasterEngine

2014-08-21 Thread Jonathan Greenberg
Ah, ok, I see what is going on. The reason you are having this issue is because clump is a focal window analysis, not a pixel-based analysis. On top of that, this is also a more complicated algorithm then you might think since it deals with connectivity. In this case, rasterEngine is almost

Re: [R-sig-Geo] Using 'raster' package functions with rasterEngine

2014-08-19 Thread Dave Marvin
Thank you for the comments Jonathan. I coerced the output from my function to an array, and that got it working. As you said the dimensions need to be ordered as (col, row). However, as you will see, there is an issue with the output in parallel mode:

Re: [R-sig-Geo] Using 'raster' package functions with rasterEngine

2014-08-11 Thread Jonathan Greenberg
Hi Dave: If you can provide some code examples that would be easier, but I can give you a couple of hints. First, use debugmode=TRUE when you are testing your function -- this will save you a lot of headaches down the line. R will enter its debugmode inside of the rasterEngine function so you

[R-sig-Geo] Using 'raster' package functions with rasterEngine

2014-08-07 Thread Dave Marvin
Hi, I am able to set up functions and apply them to a raster dataset in parallel using the rasterEngine function of the spatial.tools package, but only if the function performs just a numerical operation on the raster. When I try to incorporate a function from the raster package, such as clump(),