Description Usage Arguments Value Examples
Generate either a widget or video to view zoid behavior over the course of a game.
1 2 3 | playEpGame(g, game, episode.col, game.col, board_rep.col, zoid_rep.col,
time.col = NULL, video = F, suffix = NULL, .interval = 0.1,
justTime = F)
|
g |
A data object or string location. Used to form an object of class |
game |
A numeric. Used to select which game you are interested in. |
episode.col |
A string. Used to designate the name of the column from the object |
game.col |
A string. Used to designate the name of the column from the object |
board_rep.col |
A string. Used to designate the name of the column from the object |
zoid_rep.col |
A string. Used to designate the name of the column from the object |
time.col |
A string. Used to designate the name of the column from the object |
video |
Baoolean (default |
suffix |
A string used if |
.interval |
A numeric set to determine the duration of a frame for video playback (when |
justTime |
A boolean. Used in conjunction with |
Either a Shiny widget or Video depending on the designation of video
(and whether the "animation"
package loads).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | rda <- fread("data.txt") ## load in the file, or use sample data
data(MetaTWO)
rda <- MetaTWO
#option one, do not include "time.col". This has episodes as the top slider, and frames as the bottom slider.
playEpGame(g=rda, game = 3,game.col="V7",episode.col="V8",board_rep.col = "V24",zoid_rep.col="V25")
#option two, do include "time.col", justTime default to F. This has episodes as the top slider, and time in the episode as the bottom slider. .interval defaults to 0.1
playEpGame(g=rda, game = 3,game.col="V7",episode.col="V8",board_rep.col = "V24",zoid_rep.col="V25", time.col ="V1")
#option three, do include "time.col", set justTime to T. This has only one slider which is time. .interval defaults to 0.1
playEpGame(g=rda, game = 3,game.col="V7",episode.col="V8",board_rep.col = "V24",zoid_rep.col="V25", time.col ="V1", justTime = T, .interval = .1)
## The following results in a video. However, it requires the Animation package (and will download it if it is not installed).
## Further, requires that you externally install FFmpeg (not an R package) as that is the software animation requires to create a video
## using the function install.ffmpeg() will provide steps on how to do so. Note that creating a video takes a long time
## about as long as the game would've taken in realtime. Also note that the interval refers to how long each frame should stay on, which means that
## you're not actually getting the actual time between each frame.
playEpGame(g=rda, game = 3,game.col="V7",episode.col="V8",board_rep.col = "V24",zoid_rep.col="V25", time.col ="V1", video=T, suffix= "003", .interval = 0.1)
# Additional Example with Built-in Data
data(MetaT) ## loads in example Meta-T complete file, unaltered
playEpGame(g=MetaT, game = 2, game.col = "game_number", episode.col = "episode_number",
board_rep.col = "board_rep", zoid_rep.col = "zoid_rep")
data(MetaTWO) ## loads in example Meta-TWO game data file, unaltered
playEpGame(g=MetaTWO, game = 2, game.col = "V7", episode.col = "V8",
board_rep.col = "V24", zoid_rep.col = "V25")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.