R : How to find the location of the max value in a raster? -
how can find location of max. value in raster using r? know max. value of raster, need find location.
let's try toy raster follows:
library(raster) r = raster(nrow=10, ncol=10) r[] = runif(100,0,10) then position (index) of maximum found using
idx = which.max(r) and thhe index position coordinates of cell
pos = xyfromcell(r,idx) let me know if works
Comments
Post a Comment