Last data update: 2014.03.03

R: Recode interest area IDs and/or interest area labels
recode_iaR Documentation

Recode interest area IDs and/or interest area labels

Description

recode_ia replaces existing interest area IDs and/or labels for both eyes. For subsequent data processing, it is important that the ID values range between 0 and 8 (with 0 representing Outside all predefined interest areas). LEFT_INTEREST_AREA_ID, RIGHT_INTEREST_AREA_ID, LEFT_INTEREST_AREA_LABEL, and RIGHT_INTEREST_AREA_LABEL) for cells containing NAs. If NA, the missing values in the ID columns are relabeled as 0 and missing values in the LABEL columns are relabeled as 'Outside'.

Usage

recode_ia(data = data, IDs = NULL, Labels = NULL)

Arguments

data

A data table object output by relabel_na.

IDs

A named character vector specifying the desired interest area IDs and the corresponding existing IDs where the first element is the old value and the second element is the new value.

Labels

A named character vector specifying the desired interest area labels and the corresponding existing labels where the first element is the old value and the second element is the new value.

Value

A data table with the same dimensions as data.

Examples

## Not run: 
library(VWPre)
# To recode both IDs and Labels...
df <- recode_ia(data=dat, IDs=c("234"="2", "0"="0", "35"="3", "11"="1", "
4"="6666"), Labels=c(Outside="Dumb", Target="Targ", Dist2="Stupid", 
Comp="Comp", Dist1="Distractor1"))

## End(Not run)

Results