mps_on_date: MPs on or between two dates

View source: R/mps_on_date.R

mps_on_dateR Documentation

MPs on or between two dates

Description

Retrieve information on all MPs who were members of the House of Commons on a date or between two dates.

Usage

mps_on_date(
  date1 = Sys.Date(),
  date2 = NULL,
  constituency = FALSE,
  tidy = TRUE,
  tidy_style = "snake_case"
)

Arguments

date1

The date to return the list of MPs from. Accepts character values in 'YYYY-MM-DD' format, and objects of class Date, POSIXt, POSIXct, POSIXlt or anything else than can be coerced to a date with as.Date(). Defaults to current system date.

date2

An optional query parameter. Accepts character values in 'YYYY-MM-DD' format, and objects of class Date, POSIXt, POSIXct, POSIXlt or anything else than can be coerced to a date with as.Date(). If a proper date, the function returns a list of all MPs who were members between date2 and date1. Defaults to NULL.

tidy

If TRUE, fixes the variable names in the tibble to remove special characters and superfluous text, and converts the variable names to a consistent style. Defaults to TRUE.

tidy_style

The style to convert variable names to, if tidy = TRUE. Accepts one of 'snake_case', 'camelCase' and 'period.case'. Defaults to 'snake_case'.

Details

Returns information on all MPs who were members of the House of Commons on the date specificed (if only one date is included as a parameter), or on or between the two dates if both are specified.

This function is identical to the mnis_mps_on_date function from the ⁠[mnis](https://cran.r-project.org/package=mnis)⁠ package.

Value

A tibble with information on all MPs who were members of the House of Commons on the date specificed (if only date1 is included as a parameter), or on or between the two dates if both date1 and date2 are specified.

Examples

## Not run: 
x <- mps_on_date(date1 = "2017-04-19", date2 = "2010-05-04")

## End(Not run)

EvanOdell/parlitools documentation built on May 8, 2023, 6:57 a.m.