extract_x.Rd
extract_x
extracts the x coordinates from a time-normalized mousetrap
object.
extract_x(
mousetrap,
ID_column,
timestamps,
verbose = TRUE)
A mousetrap
object containing time-normalized data (commonly achieved using mousetrap::mt_time_normalize).
obsolete: Specify mousetrap
instead. For now, tn_data
remains useable. It will be depricated in due time. tn_data
is the time-normalized mouse-tracking data. Can be extracted from the mousetrap
object via df$tn_trajectories
.
To maintain identification of individual trials, specify your ID variable. In older versions, this had to be part of tn_data
.
Specify the number of timestamps you have used for time-normalizing.
If TRUE
(which is the default), a progress bar is displayed.
A data frame.
key
- Numbered coordinates per mouse-track ID.
value
- The x coordinate value.
ID
- Mouse-track IDs.
Kieslich, P. J., Henninger, F., Wulff, D. U., Haslbeck, J. M. B., & Schulte-Mecklenbeck, M. (2019). Mouse-tracking: A practical guide to implementation and analysis. In M. Schulte-Mecklenbeck, A. Kühberger, & J. G. Johnson (Eds.), A Handbook of Process Tracing Methods (pp. 111-130). New York, NY: Routledge.
x_data <- extract_x(mousetrap = mtqgam_mousetrap,
ID_column = "ID",
timestamps = 100,
verbose = FALSE)
head(x_data)
#> key value ID
#> 1 X1 1830 382
#> 2 X1 1576 427
#> 3 X1 1867 400
#> 4 X1 1668 411
#> 5 X1 1862 432
#> 6 X1 1867 400