China Map
cn <- get_map_china()
ggplot() + geom_map(aes(long, lat, map_id=id, fill=group), map=cn, data=cn) + coord_map() +
theme(legend.position='none')
## Warning: Ignoring unknown aesthetics: x, y
gd <- get_map_china('广东省')
ggplot() + geom_map(aes(long, lat, map_id=id), map=gd, data=gd, fill='steelblue', size=1) + coord_map()
## Warning: Ignoring unknown aesthetics: x, y
tw <- get_map_china('台湾省')
ggplot() + geom_map(aes(long, lat, map_id=id), map=tw, data=tw, fill='firebrick', size=1) + coord_map()
## Warning: Ignoring unknown aesthetics: x, y
hk <- get_map_china('香港特别行政区')
ggplot() + geom_map(aes(long, lat, map_id=id), map=hk, data=hk, fill='slateblue', size=1) + coord_map()
## Warning: Ignoring unknown aesthetics: x, y
bj <- get_map_china('北京市')
ggplot() + geom_map(aes(long, lat, map_id=id), map=bj, data=bj, fill='red', size=1) + coord_map()
## Warning: Ignoring unknown aesthetics: x, y
Session info
Here is the output of sessionInfo()
on the system on which this document was compiled:
## R version 3.3.2 (2016-10-31)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## Running under: OS X El Capitan 10.11.6
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] methods stats graphics grDevices utils datasets base
##
## other attached packages:
## [1] chinamap_0.2.0 ggplot2_2.2.0 sp_1.2-3
##
## loaded via a namespace (and not attached):
## [1] Rcpp_0.12.8 knitr_1.15.1 magrittr_1.5 maps_3.1.1
## [5] munsell_0.4.3 colorspace_1.3-1 lattice_0.20-34 stringr_1.1.0
## [9] plyr_1.8.4 tools_3.3.2 grid_3.3.2 gtable_0.2.0
## [13] htmltools_0.3.5 yaml_2.1.14 lazyeval_0.2.0 rprojroot_1.1
## [17] digest_0.6.10 assertthat_0.1 tibble_1.2 mapproj_1.2-4
## [21] prettydoc_0.2.0 evaluate_0.10 rmarkdown_1.2 labeling_0.3
## [25] stringi_1.1.2 scales_0.4.1 backports_1.0.4