Quantcast
Channel: Active questions tagged raster-calculator - Geographic Information Systems Stack Exchange
Viewing all articles
Browse latest Browse all 206

Normalize raster in R

$
0
0

I'm a noob in R.I want to normalize all imported rasters (0-1) through R, I use the scale function but the range of the results is not between 0-1. I would like to know if there is any way to normalize a raster layer or a way to normalize the whole raster stack.

    precipitation2008_2018_pre <- raster('precipitation.tif')    precipitation2008_2018_pre###class      : RasterLayer ##dimensions : 1859, 1802, 3349918  (nrow, ncol, ncell)##resolution : 100.0063, 100  (x, y)##extent     : 342449.5, 522660.8, 3334993, 3520893  (xmin, xmax, ymin, ymax)##crs        : +proj=utm +zone=50 +datum=WGS84 +units=m +no_defs ##source     : precipitation.tif ##names      : precipitation ##values     : 0, 1705.285  (min, max)       normal_pre <- scale(precipitation2008_2018_pre)    precipitation2008_2018<-normal_pre    precipitation2008_2018###class      : RasterLayer ##dimensions : 1859, 1802, 3349918  (nrow, ncol, ncell)##resolution : 100.0063, 100  (x, y)##extent     : 342449.5, 522660.8, 3334993, 3520893  (xmin, xmax, ymin, ymax)##crs        : +proj=utm +zone=50 +datum=WGS84 +units=m +no_defs ##source     : memory##names      : precipitation ##values     : -0.9642503, 1.359989  (min, max)

Viewing all articles
Browse latest Browse all 206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>