cash-set-Itempool-method: Set values to parameters or components of 'Itempool' class.

Description Usage Arguments Value Author(s) Examples

Description

Set values to parameters or components of 'Itempool' class.

Usage

1
2
## S4 replacement method for signature 'Itempool'
x$name <- value

Arguments

x

Itempool-class object.

name

Name of the parameter or component. Currently only misc, item_id, id, content, item_list are available.

value

The new value that will be assigned.

'item_id'

For item_id, the value should be a list of strings that has the same length as the number of items in the Itempool-class object, i.e. ip$n$items. There should not be any duplicated ID's. If there are Testlet-class objects in the item pool, the items within the testlet elements will be updated.

'id'

For id, the value should be a list of strings that has the same length as the length of the Itempool-class object. There should not be any duplicated ID's. If there are only Item-class objects, then item ID's will be updated. If there are Testlet-class objects in the item pool, then only the testlet IDs will be updated. Items within the Testlet can be updated using ..$item_id.

'content'

For content, the value should be either NULL or a list of strings that has the same length as the length of the Itempool-class object.

'item_list'

For item_list, the value should be a list of Item-class or Testlet-class objects.

'misc'

For misc, the value should be a list.

Value

This operation will return an Itempool-class object.

Author(s)

Emre Gonulates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ip <- generate_ip(model = "3PL", n = 5)
ip$a
# Set new values for the a parameters
ip$a <- 2
# Set new values for the b parameters
ip$b <- -2:2
# Set new ids
ip$item_id <- paste0("my-item-", 5:9)

# Set new item content
ip$content <- c("Geometry", "Algebra", "Algebra", "Geometry", "Geometry")

# Add misc field to all items:
ip$difficulty <- c("Easy", "Easy", "Hard", "Hard", "Hard")

irt documentation built on Nov. 9, 2021, 9:07 a.m.