GetRankings: Get team rankings

Description Usage Arguments Details Value Columns See Also Examples

Description

The results vary depending on the season requested. The 2016 data fields are listed here. See the FIRST API documentation for data fields for prior seasons.

Usage

1
2
3
4
5
6
7
8
GetRankings(
  session,
  event,
  team = NULL,
  top = NULL,
  mod_since = NULL,
  only_mod_since = NULL
)

Arguments

session

A Session object created with GetSession().

event

A character vector containing a FIRST API event code (see GetEvents).

team

An integer vector containing a team number. Optional.

top

An integer vector specifying the number of teams to return, starting with the top ranked team.

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

See the Event Rankings 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/rankings/event?teamNumber=team&top=top

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, "Rankings"). 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. rank: integer

  2. team: integer

  3. sortOrder1, sortOrder2, sortOrder3, sortOrder4, sortOrder5, sortOrder6: integer or numeric.

  4. wins, losses, ties: integer

  5. qualAverage: numeric

  6. dq: integer

  7. matchesPlayed: 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)
CWU_rankings <- GetRankings(sn, "WAAMV")
frc1938_rank_PNWChamps <- GetRankings(sn, "PNCMP", team = 1983)
archimedes_top5_teams <- GetRankings(sn, "ARCHIMEDES", top = 5)

irwinsnet/firstapiR documentation built on Dec. 22, 2020, 5:13 p.m.