countryCentroids: Point locations of countries

Description Usage Format Details Source Examples

Description

Gives the latitude/longitude centroid for each country. This is useful for making dot or other geom_point layers for each country.

Usage

1
data("countryCentroids")

Format

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?)

Details

This was generated by by averaging the polygon boundry points for each country.

Source

The original shapefile comes from www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip

Examples

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)

dtkaplan/DCF-devel documentation built on May 15, 2019, 4:58 p.m.