loadItemAttrib can read item attributes a data.frame or a .csv file. loadItemAttrib is a data loading function for creating an item_attrib object.

loadItemAttrib(object, pool)

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.

Value

loadItemAttrib returns an item_attrib object.

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)
#> [1] TRUE