Learn R Programming

eye (version 0.1.0)

recodeye: Recode eyes

Description

recoding eyes to "r" and "l"

Usage

recodeye(
  x,
  to = c("r", "l"),
  eyecodes = list(c("r", "re", "od", "right"), c("l", "le", "os", "left")),
  numcode = NULL
)

Arguments

x

vector of strings

to

to which codes. Right coded first.

eyecodes

list of substrings which should be converted to right and left eyes - first vector for right, then for left eyes

numcode

if you have numeric coding which is not 0:1 or 1:2 for right:left, specify it here.

Value

Character vector

See Also

Other string matching functions: getElem, set_codes(), sort_substr(), str_func_facs

Examples

Run this code
# NOT RUN {
x <- c("r", "re", "od", "right", "l", "le", "os", "left")
recodeye(x)
## chose the resulting codes
recodeye(x, to = c("right", "left"))
x <- 1:2
recodeye(x)
## or, if right is coded with 2)
recodeye(x, numcode = 2:1)

# }

Run the code above in your browser using DataLab