Skip to contents

Returns one row per observation of one controller: its position in the file, the button states, the numeric channels, the selected stick representations and the commands. Columns are named by the keys of button_layout() and channel_layout(). For an unassigned replayr_poll_stream the result is that of polls().

Usage

# S3 method for class 'replayr_movie'
as.data.frame(x, row.names = NULL, optional = FALSE, ..., idx = 1L)

# S3 method for class 'replayr_poll_stream'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

A replayr_movie or replayr_poll_stream.

row.names, optional

As in base::as.data.frame(); optional is not used.

...

Not used.

idx

Player index, 1-based.

Value

A data frame. observation is the position of the row in the file, which differs from the row number after a selection with [. A numeric channel whose key is also the key of a button has _value appended to its name.

Examples

movie <- read_movie(system.file("extdata", "sample.dtm", package = "replayr"))
head(as.data.frame(movie))
#>   observation dpad_right dpad_left dpad_down dpad_up start     b     a     x
#> 1           1       TRUE     FALSE     FALSE   FALSE  TRUE  TRUE  TRUE  TRUE
#> 2           2       TRUE     FALSE     FALSE   FALSE FALSE  TRUE  TRUE  TRUE
#> 3           3       TRUE     FALSE     FALSE   FALSE FALSE  TRUE  TRUE  TRUE
#> 4           4       TRUE     FALSE     FALSE   FALSE FALSE  TRUE  TRUE FALSE
#> 5           5       TRUE     FALSE     FALSE   FALSE FALSE  TRUE FALSE FALSE
#> 6           6       TRUE     FALSE     FALSE   FALSE FALSE FALSE FALSE FALSE
#>       y    l1    r1     z left_trigger right_trigger left_x left_y right_x
#> 1 FALSE FALSE FALSE FALSE            0             0    198    128     128
#> 2 FALSE FALSE FALSE FALSE            0             0    198    130     128
#> 3 FALSE FALSE FALSE FALSE            0             0    198    132     128
#> 4 FALSE FALSE FALSE FALSE            0             0    198    133     128
#> 5 FALSE FALSE FALSE FALSE            0             0    198    135     128
#> 6 FALSE FALSE FALSE FALSE            0             0    197    137     129
#>   right_y commands
#> 1     128        0
#> 2     128        0
#> 3     128        0
#> 4     128        0
#> 5     128        0
#> 6     128        0