View source: R/loading_functions.R
loadConstraints | R Documentation |
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")
.
loadConstraints(object, pool, item_attrib, st_attrib = NULL, file = NULL)
object |
constraint specifications. Can be a |
pool |
an |
item_attrib |
an |
st_attrib |
(optional) an |
file |
(deprecated) use |
loadConstraints
returns a constraints
object. This object is used in Static
and Shadow
.
dataset_science
, dataset_reading
, dataset_fatigue
, dataset_bayes
for 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.