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.
name
common names of countries
iso_a3
country codes in ISO_a3 format: unique three letter code
long
longitude of the country's centroid
lat
latitude
group
needed for ggplot compatibility (really?)
order
needed 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.