[R-sig-Geo] spixdf2kasc error

Els Ducheyne educheyne at avia-gis.be
Tue Feb 23 14:31:36 CET 2010


Dear list
I have been working with the ADEHABITAT package for species modelling. I have data in a spatialgriddataframe and wanted to convert this to a kasc for ENFA modelling
Now I have come across an error using the spixdf2kasc function. It yields an error in cell dimensions although the grid has the same x and y resolution if you look at the spatialgriddataframe

I have managed to trace the error to rounding problem and modified the function accordingly. 
   
if (round(gr[1, 2],15) != round(gr[2, 2],15)) 
        stop("the cellsize should be the same in x and y directions")
   

My question is thus : can this also be adapted in the original spixdf2kasc function or not? How should i proceed?

Thanks for advice


More information about the R-sig-Geo mailing list