item_pool-operators: Basic operators for item pool objects

item_pool-operatorsR Documentation

Basic operators for item pool objects

Description

Create a subset of an item_pool object:

  • pool[i]

  • subsetItemPool(pool, i)

Combine two item_pool objects:

  • c(pool1, pool2)

  • combineItemPool(pool1, pool2)

  • pool1 + pool2

pool1 - pool2 excludes items in pool2 from pool1.

pool1 == pool2 tests whether two item_pool objects are identical.

Usage

subsetItemPool(x, i = NULL)

combineItemPool(x1, x2, unique = TRUE, verbose = TRUE)

## S4 method for signature 'item_pool,numeric'
x[i, j, ..., drop = TRUE]

## S4 method for signature 'item_pool'
c(x, ...)

## S3 method for class 'item_pool'
x1 + x2

## S3 method for class 'item_pool'
x1 - x2

## S3 method for class 'item_pool'
x1 == x2

Arguments

x, x1, x2

an item_pool object.

i

item indices to use in subsetting.

unique

if TRUE, remove items with duplicate IDs after combining. (default = TRUE)

verbose

if TRUE, raise a warning if duplicate IDs are found after combining. (default = TRUE)

j, drop, ...

not used, exists for compatibility.

Examples

p1 <- itempool_science[1:100]
p2 <- c(itempool_science, itempool_reading)
p3 <- p2 - p1

p1 <- itempool_science[1:500]
p2 <- itempool_science - p1
p3 <- itempool_science[501:1000]
identical(p2, p3)  ## TRUE

p <- p1 + p3
p == itempool_science ## TRUE


TestDesign documentation built on Feb. 16, 2023, 7:19 p.m.