loadItemAttrib function

Load item attributes

Load item attributes

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

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 an 'ID' column that matches with item IDs (the 'ID' column) of the item_pool object.
  • pool: an item_pool object. Use loadItemPool for this.

Returns

loadItemAttrib returns an item_attrib object.

  • data a data.frame containing item attributes.

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)

See Also

dataset_science, dataset_reading, dataset_fatigue, dataset_bayes for examples.

  • Maintainer: Seung W. Choi
  • License: GPL (>= 2)
  • Last published: 2024-08-22