Learn R Programming

TestDesign (version 1.1.3)

item_attrib-class: Load item attributes

Description

loadItemAttrib is a data loading function to create an '>item_attrib object. loadItemAttrib can read item attributes a data.frame or a .csv file.

Usage

loadItemAttrib(object, pool, file = NULL)

Arguments

object

item attributes. Can be a data.frame or the file path of a .csv file. The content should at least include column 'ID' that matches with the '>item_pool object.

pool

an '>item_pool object. Use loadItemPool for this.

file

(deprecated) use object argument instead.

Value

loadItemAttrib returns an '>item_attrib object.

See Also

dataset_science, dataset_reading, dataset_fatigue, dataset_bayes for examples.

Examples

Run this code
# NOT RUN {
## Read from data.frame:
itempool_science   <- loadItemPool(itempool_science_data)
itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science)

## Read from file: write to tempdir() for illustration and clean afterwards
f <- file.path(tempdir(), "itemattrib_science.csv")
write.csv(itemattrib_science_data, f, row.names = FALSE)
itemattrib_science <- loadItemAttrib(f, itempool_science)
file.remove(f)

## TestDesign 1.1.0 - Deprecated arguments
# }
# NOT RUN {
loadItemAttrib(object = "iatt.csv", pool) # is equivalent to
loadItemAttrib(file   = "iatt.csv", pool) # pre 1.1.0
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab