Developing Geographic Thematic Maps with R

前端 未结 6 777
终归单人心
终归单人心 2020-12-04 04:34

There are clearly a number of packages in R for all sorts of spatial analysis. That can by seen in the CRAN Task View: Analysis of Spatial Data. These packages are numerous

6条回答
  •  萌比男神i
    2020-12-04 05:19

    Check out the packages

    library(sp)
    library(rgdal)
    

    which are nice for geodata, and

    library(RColorBrewer)  
    

    is useful for colouring. This map is made with the above packages and this code:

    VegMap <- readOGR(".", "VegMapFile")
    Veg9<-brewer.pal(9,'Set2')
    spplot(VegMap, "Veg", col.regions=Veg9,
     +at=c(0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5),
     +main='Vegetation map')
    

    "VegMapFile" is a shapefile and "Veg" is the variable displayed. Can probably be done better with a little work. I don`t seem to be allowed to upload image, here is an link to the image:

提交回复
热议问题