Re: [R-sig-Geo] rasterize func: polygon values to raster cells - error msg

2012-12-19 Thread Robert J. Hijmans
Gustaf, Thanks, I think I found the bug. It happens when there is no overlap at all between polygons and raster. I think it is fixed in raster 2.0-39 (you can install from here https://r-forge.r-project.org/R/?group_id=294). Robert On Tue, Dec 18, 2012 at 10:35 AM, Gustaf Granath

Re: [R-sig-Geo] rasterize func: polygon values to raster cells - error msg

2012-12-18 Thread Gustaf Granath
Robert, Thanks for looking at this. Unfortunately, updating R and Raster did not help. Here is info you requested. Hope that helps! Gustaf tt-rasterize(SpPDF,tes,field=idd) Error in writeValues(out, fun(n), tr$row[i]) : error in evaluating the argument 'v' in selecting a method for

Re: [R-sig-Geo] rasterize func: polygon values to raster cells - error msg

2012-12-16 Thread Robert J. Hijmans
Gustaf, When reporting that something does not work, please include the result of your sessionInfo() Just after the error occurs. traceback() can also be helpful. In this case it would appear that that you are not using the current version of raster. If that is the case, please

[R-sig-Geo] rasterize func: polygon values to raster cells - error msg

2012-12-12 Thread Gustaf Granath
Hi, I have used the rasterize function to get values from a spatialPolyDataFrame variable (@data$variable) to raster: rasterize(SPDFobj, rasterObj, field=variable) For a specific case a get a, to me, strange error message . Error in writeValues(out, fun(n), tr$row[i]) : error in evaluating