Learn R Programming

hansard (version 0.4.0)

lords_written_questions: lords_written_questions

Description

Imports data on House of Lords written questions

Usage

lords_written_questions(peer_id = NULL, answering_department = NULL,
  start_date = "1900-01-01", end_date = Sys.Date(), extra_args = NULL,
  tidy = TRUE)

Arguments

peer_id

Requests a member ID and returns a data frame with all written questions asked by that member.

answering_department

Accepts a string with a department name or partial name, and returns all written questions by that department. The query acts as a search, so entering <health> will return all questions answered by the Department of Health.

start_date

The earliest date to include in the data frame, if calling all divisions, using the date the question was tabled. Defaults to '1900-01-01'.

end_date

The latest date to include in the data frame, if calling all divisions, using the date the question was tabled. Defaults to current system date.

extra_args

Additional parameters to pass to API. Defaults to NULL.

tidy

Fix the variable names in the data frame to remove extra characters, superfluous text and convert variable names to snake_case. Defaults to TRUE.

Examples

Run this code

# Returns all written questions ever
x <- lords_written_questions()

x <- lords_written_questions(peer_id = 3526, answering_department = 'cabinet')


Run the code above in your browser using DataLab