I am reading the netcdf files in R as a raster stack and the code worked fine for all datasets with resolutions up to 0.05 x 0.05, however in this one, results are messy and I am wondering if its something that has to do with memory. A sample .nc file that I use can be found here.
files = list.files(path="/my/path/.../", pattern="*.nc", full.names = T, recursive = T)
#
rast = stack()
trend_rast = stack()
mask_points =
trend_rast_mask = raster()
#
for (i in 1:length(files)) {
print(files[i])
rast = raster::stack(files[i])
print(class(rast))
file_name = print(files[i])
trend_rast = raster.kendall(rast, intercept = F, p.value = T, confidence = F, tau = T)
names(trend_rast) = c("slope","p.value","tau")
trend_rast_sen = trend_rast[[1]]
writeRaster(trend_rast_sen, paste("/my/output/", file_name, "_SEN_SLOPE", ".nc", sep=""), format="CDF", overwrite=TRUE)
}