Skip to contents

movie[i] keeps the observations i and returns a recording of the same class, so that every accessor works on the selection as on the whole recording. Whatever is stored once per observation is cut together: button states, numeric channels, commands, console controls, poll fields, and the tables of a reader that follow the observations (timing, events, subframes, source bytes).

Usage

# S3 method for class 'replayr_movie'
x[i, ...]

# S3 method for class 'replayr_poll_stream'
x[i, ...]

Arguments

x

A replayr_movie or replayr_poll_stream.

i

Observations to keep: positions, negative positions to leave out, or a logical vector with one entry per observation.

...

Not used. A recording is selected by observation only; use player() for the buttons of one controller.

Value

A recording of the class of x.

Details

The header and the tables that describe the file as a whole stay as they are, so header counts still refer to the file. observation_index in the result gives the position in the file of each observation kept.

Examples

movie <- read_movie(system.file("extdata", "sample.fm2", package = "replayr"))
first_ten_seconds <- movie[1:600]
n_observations(first_ten_seconds)
#> [1] 600
# The observations with A held.
n_observations(movie[player(movie)[, "a"]])
#> [1] 450