makeWorldMap: Create a ggplot2 frame with a world map.

Description Usage Arguments Details Value Examples

Description

This function takes in a dataset with countries as cases. Provide the country name as a three-letter iso_a3 or any common name for the country (e.g. Canada, Fiji).

Usage

1
makeWorldMap(data, varname.x)

Arguments

data

A dataset with countries as cases

varname.x

The variable name for the column that holds the countries names

Details

It standardizes the country names and merges it another dataset which includes geographic coordinates for each country. It returns a ggplot map with no layers. It prints a message indicating how many countries will not be plotted because no latitude / longitude data was found.

Value

A ggplot map object with no layers.

Examples

1
2
3
4
5
6
## Not run: 
somedat <- CIAdata(2001) # 2001 codes for GDP
p <- makeWorldMap(somedat,'country')
p + geom_polygon(col="blue",aes(fill=GDP))

## End(Not run)

dtkaplan/DCF documentation built on May 15, 2019, 4:57 p.m.