Learn R Programming

cata (version 0.0.10.9)

toMatrix: Converts 3d array of CATA data to a tall 2d matrix format

Description

Converts a three-dimensional array (I assessors, J products, M attributes) to a two-dimensional matrix with (I assessors, J products) rows and (M attributes) columns, optionally preceded by two columns of row headers.

Usage

toMatrix(X, header.rows = TRUE)

Value

A matrix with I assessors * J products in rows and M attributes in columns (preceded by 2 columns) of headers if header.rows = TRUE

Arguments

X

three-dimensional array (I assessors, J products, M attributes) where values are 0 (not checked) or 1 (checked)

header.rows

TRUE (default) includes row headers; set to FALSE to exclude these headers

Examples

Run this code
data(bread)

# convert CATA results from the first 10 consumers and the first 4 attributes
# to a tall matrix
toMatrix(bread$cata[1:10,,1:4])

Run the code above in your browser using DataLab