setAPI-methods: LegiScan Accessor Methods - setAPI

Description Usage Arguments Value Note See Also Examples

Description

Generic method for setting the api slot of the LegiScan object

Constructor method for modifying/setting the api slot of a LegiScan class object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
setAPI(legiscan, file, key)

## S4 method for signature 'LegiScan,missing,missing'
setAPI(legiscan, file = NULL,
  key = NULL)

## S4 method for signature 'LegiScan,missing,character'
setAPI(legiscan, file = NULL, key)

## S4 method for signature 'LegiScan,character,missing'
setAPI(legiscan, file, key = NULL)

Arguments

legiscan

An object of class LegiScan

file

A fully qualified file path/name where the LegiScan API key is located

key

Argument for specifying the API key in the method call

Value

Returns the LegiScan class object with user specified api slot

Note

The default file search location is in the user's home directory in a file called .legiscanAPI.

See Also

Other LegiScan Constructor Generics: setFormat, setFormat,LegiScan,logical-method; setUrl, setUrl,LegiScan-method

Other LegiScan Constructor Methods: setFormat, setFormat,LegiScan,logical-method; setUrl, setUrl,LegiScan-method

Other LegiScan Constructor Methods: setFormat, setFormat,LegiScan,logical-method; setUrl, setUrl,LegiScan-method

Other LegiScan Constructor Methods: setFormat, setFormat,LegiScan,logical-method; setUrl, setUrl,LegiScan-method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Create object of class LegiScan
myLegiScan <- legiscanR()

# Set the API key to the value of the .myApiKey file on the desktop
setAPI(myLegiScan, file = '~/Desktop/.myApiKey')

# Set the API key to a value specified in the method call
setAPI(myLegiScan, key = 'abcd1234')

# Set the API key based on the default file search location
setAPI(myLegiScan)

## End(Not run)

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