indarr {lsbclust} | R Documentation |
Create Array of Indicator Matrices
Description
This function takes a matrix
or data.frame
and the number of rating categories maxcat
and produces a three-way array of m
by maxcat
indicator matrices, one for each of the n
rows.
The input x
must be a matrix
or data.frame
of dimensions n
by m
which contains the ratings on a scale of 1 to maxcat
for m
items. Note that missing values
(NA
's) will not appear in the columns.
Usage
indarr(x, maxcat, na.add = TRUE)
Arguments
x |
a |
maxcat |
an integer indicating the maximum of the rating scale (which is assumed to start with 1) |
na.add |
logical indicating whether to add a designated category for missings or not. Defaults to TRUE. |
Value
A list of rating by item indicator matrices.
Author(s)
Pieter C. Schoonees
Examples
data("lov")
arr <- indarr(lov[1:10, 1:9], maxcat = 9)
str(arr)
[Package lsbclust version 1.1 Index]