Description Usage Arguments Value See Also Examples
Take a data frame containing behaivoral data and merge with the eyetracking data in an itrackR object. Merging is done based on ID
and any
index variables set using set_index
. Index variables should match the same ones that are in obj$header
.
1 | add_behdata(obj, beh, append = FALSE)
|
obj |
an itrackR object |
beh |
a data frame containing behavioral data. Should at least have the column |
append |
set to TRUE if you've already added behavioral data and you're adding more columns (default = FALSE, overwrite existing data). |
data frame is saved in obj$beh
, with the extra column eyetrial
which matches the eyetracking data.
Variables in obj$beh
can be used for subsetting when calling eyemerge
, plot.itrackR
, and fixation_timeseries
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# itrackr.data('edfs') returns full path to 2 edf files
z <- itrackr(edfs=itrackr.data('edfs'))
#Extracts messages like "BLOCK 1", and "TRIAL 7" and creates variables "Block" and "Trial", giving them values
# 1 and 7.
z <- set_index(z,c('Block', 'Trial'), patterns=c('BLOCK [0-9]*', 'TRIAL [0-9][0-9]*), numeric.only = TRUE)
beh <- itrackr.data('beh)
z <- add_behdata(z,beh)
#notice the new eyetrial variable...
View(z$beh)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.