time_plot: Time plot

View source: R/time_plot.R

time_plotR Documentation

Time plot

Description

Generate a plot of move times.

Usage

time_plot(
  white_move_times,
  black_move_times,
  style = "graph",
  scaling = "lichess"
)

Arguments

white_move_times

A numeric vector of move times for white, in seconds.

black_move_times

A numeric vector of move times for black, in seconds.

style

(Default = 'graph') A single-element character vector indicating the plot style. Allowed values are 'graph' for a traditional graph with axes, or 'infographic' to add a background gradient and remove the axes (similar to lichess.org).

scaling

(Default = 'lichess') A single-element character vector indicating how the plot should be scaled. Allowed values are 'none' to plot the data as is, 'lichess' to apply the same scaling function used by lichess.org.

Details

Move times (in seconds) are plotted using a scaling function borrowed from lichess.org. The logarithmic scaling function keeps short move times from disappearing into the baseline. White move times are shown as positive values, with a white fill, while black move times are shown as negative values with a dark gray fill.

Value

A ggplot object of the plotted data.

See Also

  • advantage_plot() to plot advantage data.

  • game_summary_plot() to plot move time and advantage data with a table of game stats.

Examples

  white_move_times <- c(4, 10, 5, 10)
  black_move_times <- c(3, 4, 7)
  time_plot(white_move_times, black_move_times)

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