Open integratecology opened 9 months ago
I think the best way to handle differences between raster
and terra
is to call a wrapper function in rsf.fit
, where the wrapper function calls the appropriate raster
or terra
function depending on the class of the object. I can start adding these functions as you come across incompatibilities. I'll put this one on the to-do list.
Have you done this yet? I just tried to update an rsf.fit() script with a terra raster and it gave me the same error again
Hi Chris, I'm redoing some scripts to replace raster with terra, and if I run rsf.fit() on a terra raster loaded with terra::rast(), I get an error message that says:
"Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘cellStats’ for signature ‘"SpatRaster"’"
which I guess means rsf.fit() can't yet handle terra SpatRasters. terra's equivalent of cellStats() is global(), so I think this should be a pretty easy fix.