Description Usage Arguments Details Value Examples
View source: R/firstapiR_main.R
Every firstapiR function requires a Session object as its first parameter.
1 2 3 4 5 6 7 | GetSession(
username,
key,
season = .default_season,
format = "data.frame",
staging = FALSE
)
|
username |
A character vector containing the username assigned by FIRST. |
key |
A character vector containing the authorization key assigned by FIRST, or the value "key". |
season |
An integer vector containing the 4-digit year. Must be equal to or less than the current season and greater than or equal to 2015. Optional: defaults to the current year. |
format |
A character vector that specifies the data format that will be returned by firstapiR functions. Can be "json", "data.frame", or "xml" (case insensitive). Optional: defaults to "data.frame". |
staging |
A logical vector. If set to |
The Session object is an R list that contains the FIRST API username and authorization key, season, format, and a boolean value that specifies whether to use the staging server instead of the production server.
The key
argument may be set to the value "key". If this is done, the
firstapiR functions will skip the HTTP request and will extract example data
from the R/sysdata.rda file, which is included with the firstapiR package.
This function is for testing and demonstrations when no internet connection
or valid authorization key is available. Example data frames returned by
firstapiR functions will have their local_test_data attribute set to
TRUE
and the time_downloaded attribute will be set to the date
and time that the example data was downloaded from the server and stored in
the R/sysdata.rda file.
Throws an error if season
, format
, or staging
arguments
are incorrect.
A Session object containing all GetSession parameters. The class attribute is set to c("list", "Session")
1 2 3 | sn <- GetSession("myUserName", "myAuthorizationKey")
sn <- GetSession("myUserName", "myAuthorizationKey", season = 2015)
sn$format <- "xml"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.