powered by
Adds the correct responses (key) to a data frame.
addkey(obj, keyline = NULL, keyfile = NULL, keydata = NULL)
An object containing the data imported by function read.formscanner.
read.formscanner
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.
the name of the file with the correct responses to the items. Column names should match the names of the items.
an R data frame containing the correct responses to the items. Column names should match the names of the items.
A list with data, key, and eventually weights.
data
key
weights
keyfile and keydata can contain more items than obj. In this case, items not contained in obj are dropped in the output.
keyfile
keydata
obj
addweights
data(test) data(key) testk <- addkey(test, keydata = key)
Run the code above in your browser using DataLab