Held-observation counts per control
Arguments
- movie
A replayr_movie or replayr_poll_stream returned by
read_movie()or a format-specific reader.- idx
Player index, 1-based.
Value
Named integer vector of length n_buttons(movie). Names are
the control keys of button_layout(), as for the columns of player().
Counts give the observations held, rather than the number of off-to-on
transitions.
See also
summary() for the number of activations.
Examples
movie <- read_movie(system.file("extdata", "sample.fm2", package = "replayr"))
press_counts(movie)
#> dpad_right dpad_left dpad_down dpad_up start select b
#> 900 900 900 900 6 4 900
#> a
#> 450
# As a share of the recording, for the second controller.
round(press_counts(movie, 2L) / n_observations(movie), 3)
#> dpad_right dpad_left dpad_down dpad_up start select b
#> 0.250 0.250 0.250 0.250 0.002 0.001 0.250
#> a
#> 0.125