projMap2Cube {DistatisR}R Documentation

\ reshape a data matrix from projective mapping into a brick of data for a distatis analysis.

Description

projMap2Cube reshapes a data matrix from projective mapping into a brick of data for a distatis analysis. With I products, J variables, and K blocks (assessors), the original data can be 1) "flat" (e.g., I rows as products, columns as K blocks of J Variables) or 2) "long" "flat" (e.g., K blocks of I rows as products by assessors, columns as J Variables).

Usage

projMap2Cube(Data, shape = "flat", nVars = 2, nBlocks = NULL)

Arguments

Data

a data matrix that can be I rows by J*K columns (when "flat") or I*K rows by J columns when "long".

shape

(Default: flat when "flat" the data matrix has dimensions I rows by J*K columns; when "long" the data matrix has dimensions I*K rows by J columns.

nVars

Number of variables (default = 2), relevant only when shape = "flat".

nBlocks

(Default = NULL) number of Blocks (i.e., K) of I products. Relevant only when shape = "long".

Details

the output projMap2Cube (i.e., the brick of data) is used as input to the function cubeOfCov that will create the cubeOfDistance (or covariance) that will be used as input of distatis. projMap2Cube guesses the names of the products and variables from the rownames and columns of the data, but this guess needs to be verified.

Value

An I by J by K array (i.e., a brick) to be used to create a cube of distance or covariance.

Author(s)

Herve Abdi

Examples

# Use the data from the BeersProjectiveMapping dataset
data("BeersProjectiveMapping")
# Create the I*J_k*K brick of data
dataBrick <- projMap2Cube(BeersProjectiveMapping$ProjectiveMapping, 
                        shape = 'flat',  nVars = 2)

[Package DistatisR version 1.1.1 Index]