mt_export_long {mousetrap} | R Documentation |
Export mouse-tracking data.
Description
mt_export_long
and mt_export_wide
can be used for exporting
mouse-tracking data from a mousetrap data object in long or wide format. If
desired, additional data (stored in data[[use2]]
) can be merged with
the trajectory data before export. mt_export_long
and
mt_export_wide
are wrapper functions for mt_reshape.
Usage
mt_export_long(
data,
use = "trajectories",
use_variables = NULL,
use2 = "data",
use2_variables = NULL,
...
)
mt_export_wide(
data,
use = "trajectories",
use_variables = NULL,
use2 = "data",
use2_variables = NULL,
...
)
Arguments
data |
a mousetrap data object created using one of the mt_import
functions (see mt_example for details). Alternatively, a trajectory
array can be provided directly (in this case |
use |
a character string specifying which data should be exported. The
corresponding data are selected from data using |
use_variables |
a character vector specifying which mouse-tracking variables should be exported. This corresponds to the labels of the trajectory array dimensions. If unspecified, all variables will be exported. |
use2 |
an optional character string specifying where the other trial
data can be found. Defaults to "data" as |
use2_variables |
an optional character string (or vector) specifying the
variables (in |
... |
additional arguments passed on to mt_reshape (such as
|
Value
A data.frame containing the exported data.
Functions
-
mt_export_long()
: Export mouse-tracking data in long format -
mt_export_wide()
: Export mouse-tracking data in wide format
Author(s)
Pascal J. Kieslich
Felix Henninger
See Also
mt_import_long for importing mouse-tracking data saved in a long format.
mt_import_wide for importing mouse-tracking data saved in a wide format.
Examples
# Export data in long format
# (and include information about condition and subject_nr)
mt_data_long <- mt_export_long(mt_example,
use2_variables=c("subject_nr","Condition"))
# Export data in wide format
# (and include information about condition and subject_nr)
mt_data_wide <- mt_export_wide(mt_example,
use2_variables=c("subject_nr","Condition"))