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

loadConstraints

Load constraints


Description

loadConstraints is a data loading function to create a constraints object. loadConstraints can read constraints from a data.frame or a .csv file. The contents must be in the expected format; see the vignette in vignette("constraints").

Usage

loadConstraints(object, pool, item_attrib, st_attrib = NULL, file = NULL)

Arguments

object

constraint specifications. Can be a data.frame or the file path of a .csv file. See the vignette for the expected format.

pool

an item_pool object. Use loadItemPool for this.

item_attrib

an item_attrib object. Use loadItemAttrib for this.

st_attrib

(optional) an st_attrib object. Use loadStAttrib for this.

file

(deprecated) use object argument instead.

Value

loadConstraints returns a constraints object. This object is used in Static and Shadow.

See Also

Examples

## Read from data.frame:
itempool_science    <- loadItemPool(itempool_science_data)
itemattrib_science  <- loadItemAttrib(itemattrib_science_data, itempool_science)
constraints_science <- loadConstraints(constraints_science_data,
  itempool_science, itemattrib_science)

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

## TestDesign 1.1.0 - Deprecated arguments
## Not run: 
loadConstraints(object = "consts.csv", pool, item_attrib) # is equivalent to
loadConstraints(file   = "consts.csv", pool, item_attrib) # pre 1.1.0

## End(Not run)

TestDesign

Optimal Test Design Approach to Fixed and Adaptive Test Construction

v1.2.2
GPL (>= 2)
Authors
Seung W. Choi [aut, cre] (<https://orcid.org/0000-0003-4777-5420>), Sangdon Lim [aut] (<https://orcid.org/0000-0002-2988-014X>)
Initial release
2021-01-26

We don't support your browser anymore

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