Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addkey

Add a Key to a Data Frame


Description

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

Usage

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

Examples

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

fsia

Import and Analysis of OMR Data from FormScanner

v1.1.1
GPL-3
Authors
Michela Battauz
Initial release
2017-06-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.