I would like to reclassify urban population raster data using natural breakpoint method. Although the original data does not seem to have NAs, there are two raster images that have NAs after classification, has anyone come across a similar situation?
Step 1: Load the raster data
tif <- list.files(path = "/Users/AA/Desktop/Popluation_desity",
pattern = "*.tif",
full.names = TRUE, recursive = F)
PD <- rast(tif)
plot(is.na(PD))
Step 2: Classify the raster data
quants <- classInt::classIntervals(values(HR, mat = FALSE),
style="jenks", n = 5)
PD <- terra::classify(PD, quants$brks)
After classification, I found out that there are NA appearances.