Learn R Programming

VWPre (version 1.2.5)

recode_ia: 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).

Usage

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

Value

A data table with the same dimensions as data.

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.

Examples

Run this code
if (FALSE) {
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="Outside", Target="NewTargName", 
Dist2="NewDist2Name", Comp="NewCompName", Dist1="NewDist1Name"))
 
# For a more complete tutorial on VWPre plotting functions:
vignette("SR_Interest_Areas", package="VWPre")
}

Run the code above in your browser using DataLab