The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Type: Package
Title: Downloads and Parses World Prison Brief Data
Version: 0.1.2
URL: https://danilofreire.github.io/prisonbrief/
Description: Download, parses and tidies information from the World Prison Brief project http://www.prisonstudies.org/.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: yes
Depends: R (≥ 3.0)
Imports: sf (≥ 0.6.0), dplyr (≥ 0.5.0), httr (≥ 1.2.1), magrittr (≥ 1.5), passport (≥ 0.1.1), rnaturalearth (≥ 0.1.0), rnaturalearthdata (≥ 0.1.0), rvest (≥ 0.3.2), stringr (≥ 1.2.0), tibble (≥ 1.3.3), tidyr (≥ 0.6.3), xml2 (≥ 1.1.1)
RoxygenNote: 7.1.0
Suggests: testthat
NeedsCompilation: no
Packaged: 2021-02-18 03:01:43 UTC; politicaltheory
Author: Danilo Freire [aut, cre], Robert McDonnell [aut]
Maintainer: Danilo Freire <danilofreire@gmail.com>
Repository: CRAN
Date/Publication: 2021-02-18 06:20:03 UTC

Pipe operator

Description

Pipe operator

Usage

lhs %>% rhs

Available World Prison Brief countries

Description

Prints a list of available countries to the console.

Usage

wpb_list()

Lists all countries in a region

Description

Creates a list of all countries in a given region.

Usage

wpb_region_list(
  region = c("Africa", "Asia", "Caribbean", "Central America", "Europe", "Middle East",
    "North America", "Oceania", "South America")
)

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().


Download and parse World Prison Brief time series data

Description

Download and parse World Prison Brief time series data

Usage

wpb_series(country = NULL)

Arguments

country

Country name, in the url-style used by the World Prison Brief. See note below.

Note

Important: the country names must be the url names associated with the country. These can be seen in the second column of the dataframe returned from wpb_list(). Most of these are simply lower-case versions of the country name, such as 'algeria'. Some, such as "American Samoa (USA)" are in the following format: american-samoa-usa.


Time series data on global prison population.

Description

A dataset containing information on prison population rates and total population over several years.

Usage

wpb_series_data

Format

A data frame with 1567 rows and 4 variables.

Details


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

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

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

Data on global prison population.

Description

A dataset containing information on prison population for all countries available.

Usage

wpb_tables_data

Format

A data frame with 226 rows and 11 variables.

Details

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.