get_rep_address: get_rep_address

Description Usage Arguments Value Examples

View source: R/get_rep_address.R

Description

This function interacts with the representatives endpoint of the Google Civic Information API

Usage

1
2
3
4
5
6
7
get_rep_address(
  address = NULL,
  includeOffices = NULL,
  levels = NULL,
  roles = NULL,
  key = Sys.getenv("google_civic_api")
)

Arguments

address

Address supplied as string

includeOffices

Whether to return information about offices and officials. False returns only top-level district information. Default is true.

levels

List of office levels supplied as string. Only offices that serve at least one of these levels will be returned Acceptable values are: "administrativeArea1", "administrativeArea2", "country", "international", "locality", "regional", "special", "subLocality1", "subLocality2"

roles

List of roles supplied as string. Only offices fulfilling one of these roles will be returned. Acceptable values are: "deputyHeadOfGovernment", "executiveCouncil", "governmentOfficer", "headOfGovernment", "headOfState", "highestCourtJudge", "judge", "legislatorLowerBody", "legislatorUpperBody", "schoolBoard", "specialPurposeOfficer"

key

API key supplied as a string. Defaults to the environmental variable called "google_civic_api." Info on how to get a key can be found here: https://developers.google.com/civic-information

Value

Returns a list of offices by divisions and respective officials

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
get_rep_address(
    address = "55 e monroe, chicago, il",
    level = "regional",
    role = "schoolBoard",
    key = Sys.getenv("google_civic_api")
)

## End(Not run)

willdebras/googlecivic documentation built on Feb. 15, 2021, 6:58 p.m.