LegiScan-class: LegiScan API Class object

Description Usage Arguments Value Slots Note Examples

Description

Defines a LegiScan class object which is passed to methods to submit/retrieve data from calls to the LegiScan API and for parsing data retrieve from the LegiScan API

LegiScan constructor function

LegiScan default construction method

Usage

1
2
3
4
legiscanR(...)

## S4 method for signature 'LegiScan'
initialize(.Object, urlBase, api, format)

Arguments

...

Should be passed arguments named by the slot names from getSlots("LegiScan")

.Object

a LegiScan object to create

urlBase

Root URL for LegiScan API calls

api

If specified, will search for matching file otherwise will treat as character string

format

XML or JSON API requests (set on the LegiScan website)

Value

Returns the LegiScan object if the validation tests are passed

Slots

urlBase

The base for the request URL (predefined in the class prototype)

api

The API key for the end user

format

Specifies if you have requested your API pulls in XML or JSON

Note

The default behavior for the class constructor is to read the API key from ~/.legiscanAPI. Accessor methods are available to get/set the values of the LegiScan object.

The file format returned by the LegiScan API is set up when logging into your LegiScan account. The value provided by the class object is used to select the appropriate parsing methods based on the object returned from the API call

Examples

1
2
3
4
5
# Create new object with class LegiScan
x <- legiscanR()

# Check class of the object x
class(x)

wbuchanan/legiscanR documentation built on May 4, 2019, 2:01 a.m.