I want to coerce an object of class Raster Layer to class SpatialPixelsDataFrame since that is required as input for the function autoKrige from the r library automap. However, when I try to use as from the r library methods, I get the following error:
Encountered "as" at line 307, column 25. Was expecting one of ...
Where line 307 is:
layerGrid = methods.as(layerRaster, "SpatialPixels")
I'm assuming that the word as has already has a meaning in python. The question is, however, how do I use the function as. Is it possibly replaced by rpy2 with a different name?