Learn R Programming

irt (version 0.2.9)

[,Itempool,ANY,missing-method: Subset Itempool objects

Description

Subset Itempool objects

Usage

# S4 method for Itempool,ANY,missing
[(x, i, j, ..., drop = TRUE)

Value

An Itempool-class object with elements from

Item-class.

Arguments

x

An Itempool-class object from which to extract element(s) or in which to replace element(s).

i

indices specifying elements to extract or replace.

j

This will not be used in Itempool-class objects.

...

Parameters to be passed to the function.

drop

(From R manual:) For matrices and arrays. If TRUE the result is coerced to the lowest possible dimension (see the examples). This only works for extracting elements, not for the replacement. See drop for further details.

Author

Emre Gonulates

Examples

Run this code
ip <- itempool(a = c(1.12, 2.1, 1.28), b = c(2, 3.2, 0.21),
                item_id = c("i1", "i2", "i3"))

ip[1]
# Create an Itempool using the first and third element:
ip[c(1, 3)] # Order is important
ip[c(3, 1)]
ip[-2]
ip[c(TRUE, FALSE, TRUE)]
ip[c("i2", "i1")]
# Recycle, i.e. get all elements
ip[TRUE]

Run the code above in your browser using DataLab