Visit: https://www.geocaceres.com/
—————————————————————————————————————————————————————————————————
This script create raster from random values.
library(sp)
library (raster)
raster_one <- raster(ncol=5,nrow=5,xmn=10,ymn=10,xmx=15,ymx=15)
raster_one
## class : RasterLayer
## dimensions : 5, 5, 25 (nrow, ncol, ncell)
## resolution : 1, 1 (x, y)
## extent : 10, 15, 10, 15 (xmin, xmax, ymin, ymax)
## crs : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
values(raster_one) <- rnorm(n=25,mean=0.4,sd=0.15)
values(raster_one)
## [1] 0.1761040 0.4907116 0.3900386 0.6578596 0.5071224 0.4711862 0.4208681
## [8] 0.1032632 0.5352733 0.3428345 0.6844830 0.4701022 0.4771985 0.3128309
## [15] 0.5047399 0.6801442 0.4885230 0.5420404 0.2087471 0.5167519 0.6325555
## [22] 0.3485758 0.5291833 0.5467690 0.4846635
plot (raster_one)