Learn R Programming

irt (version 0.1.1)

c,Item-method: Concatenate Item, Itempool or Testlet objects and return an Itempool object.

Description

If there are no names, function autofill the names with default names.

Usage

# S4 method for Item
c(x, ...)

# S4 method for Itempool c(x, ...)

# S4 method for Testlet c(x, ...)

Arguments

x

A list consist of Item-class objects.

...

Additional arguments

Value

An Itempool-class object.

Details

I got the idea of this function from: https://www.r-bloggers.com/vectors-of-s4-classes-with-non-trivial-slots/

Examples

Run this code
# NOT RUN {
item1 <- item(a = 1.12, b = -2.1, c = 0.28)
item2 <- item(a = 2, b = 3.2, c = 0.21)

# Concatenate items
c(item1, item2)

ip <- itempool(a = c(1, 1.2), b = c(1, 2), c = c(.2, .4))
# Concatenate items and an Itempool object
c(item1, ip)
c(item1, item2, ip)
c(ip, item1, item2)
# }

Run the code above in your browser using DataLab