get_pgn: Get the contents of a PGN file

View source: R/get_pgn.R

get_pgnR Documentation

Get the contents of a PGN file

Description

A no-frills function to read a PGN file into a tibble.

Usage

get_pgn(pgn_path)

Arguments

pgn_path

A single-element character vector of the path to a PGN file.

Details

See the PGN specification for information on the PGN format.

Each distinct tag name in the PGN file will become a tibble column with the same name as the tag. The movetext field will be an additional column with the name Movetext.

Value

A tibble where each row is a game, and each PGN tag is a column, and the PGN file's movetext field is also a column.

See Also

  • save_pgn() to save a PGN file.

  • evaluate_pgn() to analyze all the games in a PGN file

  • evaluate_game() to analyze a single game from a PGN file

  • clean_movetext() to strip comments and annotations.

  • get_clocks() to extract clock data.

  • get_evals() to extract evaluations.

  • get_increments() to extract increments.

Examples

pgn_path <- file.path(
  system.file(package = 'rbitr'),
  'extdata',
  'fools_mate.pgn'
)
get_pgn(pgn_path)

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