get_increments: Get increments from a PGN file's TimeControl tags

View source: R/get_increments.R

get_incrementsR Documentation

Get increments from a PGN file's TimeControl tags

Description

Extract the increments from a PGN file's time control tags. For allowed time control formats, see the PGN specification .

Usage

get_increments(time_control)

Arguments

time_control

A character vector of TimeControl tags.

Details

The get_increments() function is intended for use with data that was read from a PGN file with the get_pgn() function. If a TimeControl tag was present in the PGN file, a tibble obtained using get_pgn() will have a $TimeControl column from which the increment data can be extracted. Note that there are six different time control formats recognized by the PGN specification, only one of which uses increments. All other formats will return an increment of 0 (see example).

Value

An integer vector of the increments, in seconds. Time controls with no increment return 0.

See Also

  • get_pgn() to load the time control and other data from a PGN file.

  • get_clocks() to extract the clock data from a PGN file.

  • get_move_times() to calculate move times from clock and increment data.

  • time_plot() and game_summary_plot() to plot move times.

Examples

time_control <- c('?', '-', '40/9000', '300', '4500+60', '*180')
get_increments(time_control)

dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.