To compute Tbox and Obox, the function needs the following variables:
game_id, playlength, ShotType, points, result, team, oreb, dreb, PF, turnover, assist, block and steal.
If any of these variables is missing, an error message is displayed.
To compute Pbox, also the variables player, a1 . . . a5, h1 . . . h5 and hometeam are needed.
If any is omitted, only Tbox and Obox are given in output.
Note that the variables assist, block and steal can contain the logical indicator of whether the corresponding event has occurred (TRUE/FALSE or numerical 0/1) or the name of the involved player (character).
In the former case, Tbox and Obox are fully computed, while the variables AST, BLK and STL are missing in the Pbox data frame.
In the latter case, all the data frames Tbox, Obox and Pbox are fully computed.
TOPboxes omits the computation of the variables W (Games won) and L (Games lost).
In fact, since we aim at computing box scores starting from whatever portion of play-by-play data (e.g., only a part of a game), in some cases, calculating the number of won and lost games does not make sense.