GetHybridSchedule: Get the match schedule and results

Description Usage Arguments Details Value Columns See Also Examples

View source: R/firstapiR_main.R

Description

For matches that have been played, GetHybridSchedule returns the teams assigned to the match and the match results. If the mtach has not yet been played, the assigned teams and schedule data are returned, but the result fields are blank.

Usage

1
2
3
4
5
6
7
8
9
GetHybridSchedule(
  session,
  event,
  level = "qual",
  start = NULL,
  end = 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).

level

A character vector containing either "qual" or "playoff". Optional: defaults to "qual".

start

An integer vector containing the earliest match to return. Optional.

end

An integer vector containing the latest match to return. Optional.

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

The data frame returned by GetHybridSchedule() is in team shape, i.e., each row contains data for a single team and there are six rows per match. Use ToAllianceShape() or ToMatchShape() to convert the data frame to a three-teams-per-row shape or a six-teams-per-row shape.

See the Hybrid Schedule section of the FIRST API documentation for more details.

The FIRST API URL format is:

https://frc-api.firstinspires.org/v2.0/season/schedule/event/level/ hybrid?start=start&end=end

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, "HybridSchedule"). 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. match: integer

  2. description: character

  3. level: factor

  4. start: character

  5. actualStart: character

  6. team: factor

  7. alliance: factor (Blue, Red)

  8. station: factor (Red1, Red2, Red3, Blue1, Blue2, Blue3)

  9. surrogate: logical

  10. disqualified: logical

  11. scoreFinal, scoreAuto, scoreFoul: 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)
Philometh_qual_sched <- GetHybridSchedule(sn, event = "ORPHI")
CWU_playoffs <- GetHybridSchedule(sn, event = "WAELL", level = "playoff",
                                  start = 3, end = 6)

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