Learn R Programming

TestDesign (version 1.0.2)

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

An item_attrib object containing item attributes. Use loadItemAttrib for this.

st_attrib

(Optional) An st_attrib object containing stimulus attributes. Use loadStAttrib for this.

Value

A constraints object containing the parsed constraints, to be used in Static and Shadow.

Details

Use vignette("constraints") for instructions on how to create the constraint file.

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