Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. library(raster)
  2.  
  3. # create raster data from scratch
  4. # create empty raster
  5. y1<-raster(ncol = 3, nrow = 3)
  6.  
  7. values(y1)<-1:9
  8.  
  9. projection(y1)<-CRS("+init=epsg:4326")
  10.  
  11. # create and diversify the rasters
  12. y2<-y1+10
  13. y3<-y1+20
  14. y4<-y1+30
  15.  
  16. # make list of rasters
  17. y.list<-list(y1, y2,y3,y4)
  18.  
  19. # plot all rasters at once
  20. par(mfrow = c(2,2))
  21.  
  22. for(i in 1:length(y.list)) {
  23. plot(y.list[[i]])
  24. }
  25.  
  26. y1 y2 y3 y4
  27. pixel1 1 10 20 30
  28. pixel2
  29. ...
  30. pixel9 9 19 29 39
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement