Extract first N moves from pgn movetext into data frame
Usage
extract_moves(movetext, N = 10, last.move = T)
Arguments
movetext
movetext string (or string vector). The standard English values are required: pawn = "P" (often not used), knight = "N", bishop = "B", rook = "R", queen = "Q", and king = "K".
N
integer (default 10) determines how many first N moves will be extracted. Default is 10, should be greater than 0.
last.move
boolean (default TRUE) indicating whether to calculate the last move
Value
Data frame containing first N moves for white and for black, named as W1, B1, W2 and so on, up to WN and BN (where N is input argument). If N is greater than total moves number then NA's generated. Column complete.movetext flag is indicating if movetext string begin with "1.'move'".