Can't Calculate pixel-wise regression in R on raster stack with fun
问题 I am working with rasters and I've a RasterStack with 7n layers. I would like to calculate pixel-wise regression, using formula beneath. I was trying to do it with raster::calc , but my function failed with message : 'Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases.' But all rasters are OK, and contain numbers (not only NAs), I can plot it, and I can calculate general linear regression with formula cr.sig=lm (raster::as.array(MK_trend.EVI.sig_Only) ~