wpb_table {prisonbrief} | R Documentation |
Download and parse World Prison Brief data
Description
Download and parse World Prison Brief data
Usage
wpb_table(
region = c("Africa", "Asia", "Caribbean", "Central America", "Europe", "Middle East",
"North America", "Oceania", "South America", "All"),
country = NULL
)
Arguments
region |
|
country |
|
Value
Data Frame with 10 variables:
country
character
.prison_population_rate
integer
, per 100,000 of the national population.prison_population_total
integer
.female_prisoners
numeric
, (percentage of total prison pop.).pre_trial_detainees
numeric
, (percentage of total prison pop.).foreign_prisoners
numeric
, (percentage of total prison pop.).occupancy_level
numeric
, (percentage based on official capacity).iso_a2
character
. See notes.geometry
sfc_MULTIPOLYGON
.
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
## 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)