Description Usage Format Details Source Examples
Gives the latitude/longitude centroid for each country. This is useful for making dot or other geom_point layers for each country.
1 | data("countryCentroids")
|
A data frame with 241 observations on the following 6 variables.
namecommon names of countries
iso_a3country codes in ISO_a3 format: unique three letter code
longlongitude of the country's centroid
latlatitude
groupneeded for ggplot compatibility (really?)
orderneeded for ggplot compatibility (really?)
This was generated by by averaging the polygon boundry points for each country.
The original shapefile comes from www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip
1 2 3 4 5 6 7 8 | ## Not run:
population <- CIAdata(2119)
population2 <- left_join(population,mutate(countryCentroids,country=name))
p <- makeWorldMap(population,'country')
p + geom_polygon( color='gray', fill=NA) + # for the boundaries
geom_point(data=population2, aes(x=long,y=lat,size=sqrt(pop)))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.