Coercing “itemresp” data objects to other classes.
Usage
## S3 method for class 'itemresp'
as.list(x, items = NULL, mscale = TRUE, df = FALSE, ...)
Arguments
x
an object of class “itemresp”.
items
character, integer, or logical for subsetting the items.
mscale
logical. Should the measurement scale labels be used for creating factor levels? If FALSE, the values 0, 1, … are used.
df
logical. Should a data frame of factors be returned? If FALSE, a plain list of factors is returned.
…
currently not used.
Details
The as.list method coerces item response data to a list (or data frame) of factors with factor levels either taken from the mscale(x) or as the values 0, 1, ….
The as.data.frame method returns a data frame with a single column of class “itemresp”.
Furthermore, as.matrix, as.integer, as.double all return a matrix with the item responses coded as values 0, 1, …
The as.character method simply calls format.itemresp.
is.itemresp can be used to check wether a given object is of class “itemresp”.