Learn R Programming

hansard (version 0.6.0)

members_search: Search for an MP or Peer by name and constituency

Description

Function searches for the string and returns a tibble with all matches from both houses of parliament. Returns all partial matches in the members' names, constituencies, twitter handle and webpage. The default search is NULL, which returns a tibble of all members of both houses, the same result as members().

Usage

members_search(search = NULL, tidy = TRUE, tidy_style = "snake_case",
  verbose = TRUE)

hansard_members_search(search = NULL, tidy = TRUE, tidy_style = "snake_case", verbose = TRUE)

Arguments

search

Accepts any string. Defaults to NULL. If NULL, returns a tibble with all members of both houses of parliament. Searchs are not case sensitive.

tidy

Logical parameter. 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'.

verbose

If TRUE, returns data to console on the progress of the API request. Defaults to TRUE.

Value

A tibble with the results of the search.

See Also

members

Examples

Run this code
# NOT RUN {
x <- members_search('chris')

x <- members_search(search='chris')
# }

Run the code above in your browser using DataLab