Add a Key to a Data Frame
Adds the correct responses (key) to a data frame.
addkey(obj, keyline = NULL, keyfile = NULL, keydata = NULL)
obj |
An object containing the data imported by function |
keyline |
the number of line of the data containing the correct responses to the items. This line is deleted from the data and used as key. |
keyfile |
the name of the file with the correct responses to the items. Column names should match the names of the items. |
keydata |
an R data frame containing the correct responses to the items. Column names should match the names of the items. |
keyfile
and keydata
can contain more items than obj
.
In this case, items not contained in obj
are dropped in the output.
A list with data
, key
, and eventually weights
.
Michela Battauz
data(test) data(key) testk <- addkey(test, keydata = key)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.