loadItemAttrib: Load item attributes

View source: R/loading_functions.R

item_attrib-classR Documentation

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.

  • data a data.frame containing item attributes.

See Also

dataset_science, dataset_reading, dataset_fatigue, dataset_bayes for examples.

Examples

## 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

## End(Not run)


TestDesign documentation built on Feb. 16, 2023, 7:19 p.m.