Converting spatial polygon to regular data frame without use of gpclib tools

前端 未结 1 1095
花落未央
花落未央 2020-12-20 16:38

I working with spatial data in R for a commercial application and would like to use ggplot2 for data visualization. If you run the Hadley\'s example at https://github.com/ha

相关标签:
1条回答
  • 2020-12-20 17:25

    You need to also install the rgeos package. When maptools is loaded and rgeos is not installed, the following message is shown:

    > require("maptools")
    Loading required package: maptools
    Checking rgeos availability: FALSE
        Note: when rgeos is not available, polygon geometry
        computations in maptools depend on gpclib,
        which has a restricted licence. It is disabled by default;
        to enable gpclib, type gpclibPermit()
    

    When fortify is called with a region argument (as it is in the example you linked to), then some "polygon geometry computations" need to be done. If rgeos is not available, and gpclib is not permitted, it will fail.

    0 讨论(0)
提交回复
热议问题