$<-,Itempool-method {irt}R Documentation

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

Description

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

Usage

## 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

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")
ip$difficulty

# Add an overall misc field to itempool:
ip$form_name <- "Frm8"

# Remove the misc field from all items
ip$difficulty <- NULL
ip$difficulty


[Package irt version 0.2.9 Index]