Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(raster)
- # create raster data from scratch
- # create empty raster
- y1<-raster(ncol = 3, nrow = 3)
- values(y1)<-1:9
- projection(y1)<-CRS("+init=epsg:4326")
- # create and diversify the rasters
- y2<-y1+10
- y3<-y1+20
- y4<-y1+30
- # make list of rasters
- y.list<-list(y1, y2,y3,y4)
- # plot all rasters at once
- par(mfrow = c(2,2))
- for(i in 1:length(y.list)) {
- plot(y.list[[i]])
- }
- y1 y2 y3 y4
- pixel1 1 10 20 30
- pixel2
- ...
- pixel9 9 19 29 39
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement