addkey: Add a Key to a Data Frame

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Adds the correct responses (key) to a data frame.

Usage

1
addkey(obj, keyline = NULL, keyfile = NULL, keydata = NULL)

Arguments

obj

An object containing the data imported by function read.formscanner.

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.

Details

keyfile and keydata can contain more items than obj. In this case, items not contained in obj are dropped in the output.

Value

A list with data, key, and eventually weights.

Author(s)

Michela Battauz

See Also

addweights

Examples

1
2
3
data(test)
data(key)
testk <- addkey(test, keydata = key)

fsia documentation built on May 2, 2019, 5:42 a.m.