GetTeams: Get details on FRC teams

Description Usage Arguments Details Value Columns See Also Examples

Description

Provides lists of FRC teams for specified events, districts, and states. With no parameters (except for session), GetTeams will provide a list of all FRC teams.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
GetTeams(
  session,
  team = NULL,
  event = NULL,
  district = NULL,
  state = NULL,
  page = NULL,
  mod_since = NULL,
  only_mod_since = NULL
)

Arguments

session

A Session object created with GetSession().

team

An integer vector containing a team number. Optional.

event

Character A FIRST API event code (see GetEvents()). If event is specified, GetTeams() will filter results to all teams particpating in the specified event. Optional.

district

A character vector containing a FIRST API district code (see GetDistricts()). If specified, the FIRST API server will filter the response to only the teams in the specified district. Optional.

state

A character vector containing a state name, spelled out entirely (i.e., 'Idaho', not 'ID'). If state is specified, GetTeams() will filter results to all teams in the specified state. Optional.

page

An integer vector that specifyies which page of results should be returned. Optional. Use only for XML or JSON formats.

mod_since

A character vector containing an HTTP formatted date and time. Returns NA if no changes have been made to the requested data since the date and time provided. Optional.

only_mod_since

A character vector containing an HTTP formatted date and time. This function only returns data that has changed since the date and time provided. Optional.

Details

Because the length of the GetTeams response can be several thousand lines long, the FIRST API server will break up its response into several pages when the number of teams in the response exceeds 65. For the data frame format, GetTeams will send a request to the FIRST API server and determine from the first response whether additional HTTP requests are necessary to retrieve all requested data. GetTeams will then merge all responses into a single data frame. For XML and JSON formats, the user will have to call GetTeams for each page of data, specifying the page with the page argument.

See the Team Listings section of the FIRST API documentation at http://docs.frcevents2.apiary.io/# for more details.

The FIRST API URL format is:

https://frc-api.firstinspires.org/v2.0/season/teams&eventCode=event ?districtCode=district?state=state?page=2

Value

Depending on the session$format value, returns JSON text, an XML::XMLDocument object, or a data.frame with class set to c("data.frame, "Teams"). Returns a logical vector of length one with value NA if data is unchanged since date and time passed in arguments mod_since or only_mod_since.

Columns

  1. team: character

  2. nameFull: character

  3. nameShort: character

  4. city: character

  5. stateProv: factor

  6. country: factor

  7. website: character

  8. rookieYear: integer

  9. robotName: character

  10. districtCode: factor

  11. teamCountTotal: integer

  12. teamCountPage: integer

  13. pageCurrent: integer

  14. pageTotal: integer

See Also

Refer to Standard_attributes for data attributes returned by this function.

Examples

1
2
3
4
sn <- GetSession("username", "key", season = 2016)
GetTeams(sn, state = "California")
GetTeams(sn, district = "FIM")
GetTeams(sn, event = "CMP-CARVER")

irwinsnet/FIRST_api_R documentation built on Dec. 22, 2020, 5:12 p.m.