I am stuck on the water package. The example code I am following is at this website https://cran.r-project.org/web/packages/water/vignettes/Landsat8.html. I am using my own data and am able to read both my original landsat image and the surface reflectance image with my area of interests (aoi). I get the following error when I use this code.
hot.and.cold <- calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = F, albedo = albedo, Z.om = Z.om, n = 1, anchors.method = "flexible",
+ WeatherStation = WeatherStation, verbose = F)
Error in .local(x, ...) :
RasterLayer has no NA cells (for which to compute a distance)