recode_ia: Recode interest area IDs and/or interest area labels

Description Usage Arguments Value Examples

View source: R/ias.R

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

1
recode_ia(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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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="Outside", Target="NewTargName", 
Dist2="NewDist2Name", Comp="NewCompName", Dist1="NewDist1Name"))
 
# For a more complete tutorial on VWPre plotting functions:
vignette("SR_Interest_Areas", package="VWPre")

## End(Not run)

VWPre documentation built on Jan. 11, 2020, 9:28 a.m.