Usage
mt_import_wide(raw_data, xpos_label = "X", ypos_label = "Y", zpos_label = NULL, timestamps_label = "T", add_labels = NULL, mt_id_label = NULL, pos_sep = "_", pos_ids = NULL, reset_timestamps = TRUE, verbose = TRUE)
Arguments
raw_data
a data.frame containing the raw data.
xpos_label
a character string specifying the core of the column labels
containing the x-positions (e.g., "X" for "X_1", "X_2", ...).
ypos_label
a character string specifying the core of the column labels
containing the y-positions (e.g., "Y" for "Y_1", "Y_2", ...).
zpos_label
a character string specifying the core of the column labels
containing the z-positions.
timestamps_label
an optional character string specifying the core of
the column labels containing the timestamps. If no timestamps are found in
the data, a timestamps variable with increasing integers will be created
(assuming equidistant time steps).
add_labels
a character vector specifying the core of columns
containing additional mouse-tracking variables.
mt_id_label
an optional character string (or vector) specifying the
name of the column that provides a unique ID for every trial (the trial
identifier). If unspecified (the default), an ID variable will be
generated. If more than one variable name is provided, a new ID variable
will be created by combining the values of each variable. The trial
identifier will be set as the rownames of the resulting trajectories
and trial data, and additionally be stored in the column "mt_id" in the
trial data. pos_sep
a character string indicating the character that connects the
core label and the position, (e.g., "_" for "X_1", "Y_1", ...).
pos_ids
the vector of IDs used for indexing the x-coordinates,
y-coordinates etc. (e.g., 1:101 for time-normalized trajectories from
MouseTracker). If unspecified (the default), column labels for the
respective variable will be extracted using grep (see Details).
reset_timestamps
logical indicating if the first timestamp should be
subtracted from all timestamps within a trial. Default is TRUE as it
is recommended for all following analyses in mousetrap.
verbose
logical indicating whether function should report its
progress.