wpb_table: Download and parse World Prison Brief data

Description Usage Arguments Value Note Examples

View source: R/wpb_table.R

Description

Download and parse World Prison Brief data

Usage

1
2
3
4
5
wpb_table(
  region = c("Africa", "Asia", "Caribbean", "Central America", "Europe", "Middle East",
    "North America", "Oceania", "South America", "All"),
  country = NULL
)

Arguments

region

character. Return details for all the countries in the particular region. For a list of the countries in each region, use wbp_region_list().

country

character. If details of a specific country are required, the country can be specified by name. A non-NULL value for this parameter will void the region argument. For a list of country names, use wpb_list().

Value

Data Frame with 10 variables:

Note

We recommend calling this function using the region argument, as the data come back in a format more useful for analysis. Querying a specific country will return a dataframe in which certain columns contain items such as parentheses and auxiliary text, rendering follow-on analysis more cumbersome. As regards the spatial information, the geometry column will be an empty list where it has not matched every entry in country. This is due to the way territories are coded according to ISO A2 codes. For example, country will contain "Jersey (United Kingdom)", whereas geometry contains information for only the United Kingdom as a whole. We hope to improve this in future releases of prisonBrief.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Get details for Spain:
espana <- wpb_table(country = "Spain")

# Get details for Central America:
CA <- wpb_table(region = "Central America")

## End(Not run)

prisonbrief documentation built on Feb. 18, 2021, 9:06 a.m.