Learn R Programming

TestDesign (version 0.2.5)

loadConstraints: Load constraints

Description

Read constraints from specified file.

Usage

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

Arguments

file

Character. The name of the file containing specifications for constraints.

pool

An item_pool object.

item_attrib

A data.frame containing item attributes. Use loadItemAttrib for this.

st_attrib

(Optional) A data.frame containing stimulus attributes. Use loadStAttrib for this.

Value

A list containing the parsed constraints, to be used in ATA and Shadow.

Details

Use vignette("constraints") for instructions on how to create a constraint set object.

See Also

dataset_science for example usage.

Examples

Run this code
# NOT RUN {
## Write to tempdir() and clean afterwards
f <- file.path(tempdir(), "itempool_science.csv")
write.csv(itempool_science_raw, f, row.names = FALSE)
itempool_science <- loadItemPool(f)
file.remove(f)

f <- file.path(tempdir(), "itemattrib_science.csv")
write.csv(itemattrib_science_raw, f, row.names = FALSE)
itemattrib_science <- loadItemAttrib(f, itempool_science)
file.remove(f)

f <- file.path(tempdir(), "constraints_science.csv")
write.csv(constraints_science_raw, f, row.names = FALSE)
constraints_science <- loadConstraints(f,
  itempool_science, itemattrib_science)
file.remove(f)

# }

Run the code above in your browser using DataLab