View source: R/tabulate_positionlog.R
tabulate_positionlog | R Documentation |
The tabulate_positionlog()
function takes a character vector of engine
analysis for a single chess position and condenses it into a data frame for
easier access.
tabulate_positionlog(
positionlog,
all_tags = FALSE,
custom_tags = NULL,
delete_blank_lines = TRUE
)
positionlog |
A character vector that contains engine analysis. |
all_tags |
(Default = |
custom_tags |
(Default = |
delete_blank_lines |
(Default = |
The tabulate_positionlog()
function tabulates data from a
UCI-compatible chess
engine and returns it as a data frame. Data sent by the engine may include
the best move, the principal variations, the current depth of search, the
number of nodes searched, and so on. The data are marked in the output by
tags such as depth
, pv
, and score
. The tags will appear in the data
frame as column names.
For a list of tags that can appear, refer to the UCI protocol. Some engines may also provide information that is not covered by the UCI protocol.
By default, the only data extracted are depth
, multipv
, score
, and
pv
. The custom_tags
parameter allows the user to choose additional tags
to extract. Setting the all_tags
parameter to TRUE
will extract all of
the tags listed in the UCI protocol.
The custom_tags
parameter may also be used for engines that supply data
not covered by the UCI protocol, but only if the engine's custom tags
conform to one of the following formats:
(tag name) (tag value)
(tag name) (move 1) (move 2) ... (move i)
where (tag name), (tag value), and (move i) are space delimited, and must not contain spaces themselves. Additionally, moves must be in the UCI LAN format. Each (move i) should consist of two chessboard squares followed by an optional promotion piece, e.g. e2e4 or e7e8q.
When requested data is not found, NA
will appear to indicate missing
values. If entire rows or columns are missing, they will be deleted. To
leave missing rows/columns in place, set the delete_blank_lines
parameter
to FALSE.
A data frame with character columns summarizing the data for the position.
tabulate_positionlog()
does not change the class of the data it
returns. Since the positionlog
parameter is a character vector, the
function will return a data frame with character columns.
The 'tabulate' functions tabulate analysis logs into data frames.
tabulate_positionlog()
for condensing analysis of one position.
tabulate_gamelog()
for condensing analysis of one game.
tabulate_pgnlog()
for condensing analysis of an entire pgn file.
The 'parse' functions extract specific data from analysis logs.
parse_gamelog()
for extracting data from one evaluated game.
parse_pgnlog()
for extracting data from games in a pgn.
The 'evaluate' functions produce analysis logs.
evaluate_position()
for analyzing chess positions.
evaluate_game()
for analyzing individual games.
evaluate_pgn()
for evaluating all the games in a PGN file.
positionlog <- c(
"info depth 1 seldepth 1 multipv 1 score cp 13 nodes 20 nps 20000 tbhits 0 time 1 pv e2e4",
"info depth 2 seldepth 2 multipv 1 score cp 14 nodes 40 nps 40000 tbhits 0 time 1 pv e2e4 e7e5",
"bestmove e2e4 ponder e7e5"
)
tabulate_positionlog(positionlog)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.