Why does rasterToPoints generate an error on first call but not second?
问题 I have some code that loops over a list of study IDs ( ids ) and turns them into separate polygons/spatial points. On the first execution of the loop it produces the following error: Error in (function (x) : attempt to apply non-function This is from the raster::rasterToPoints function. I've looked at the examples in the help section for this function and passing fun=NULL seems to be an acceptable method (filters out all NA values). All the values are equal to 1 anyways so I tried passing a