Learn R Programming

kutils (version 1.73)

makeKeylist: Convert the variable key into a list of long keys, one for each variable.

Description

A keylist element is a long key for one new variable. The new variables are named by "name_old.name_new" for uniqueness.

Usage

makeKeylist(
  key,
  sep = c(character = "\\|", logical = "\\|", integer = "\\|", factor = "\\|",
    ordered = "[\\|

Value

A list with one element per variable name, along with some attributes like class_old and class_new. The class is set as well, "keylist"

Arguments

key

A key object or a file name, csv, xlsx or rds.

sep

Separator regular expressions

na.strings

Strings that will be treated as NA. This will be used only if the key object does not have an na.strings attribute.

Author

Paul Johnson <pauljohn@ku.edu>

Details

If the key has one old variable being recoded 6 ways, that begets 6 elements in the resulting list. Attributes including the classes of the old and new variables are included.