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 II products, JJ variables, and KK blocks (assessors), the original data can be 1) "flat" (e.g., II rows as products, columns as KK blocks of JJ Variables) or 2) "long" "flat" (e.g., KK blocks of II rows as products by assessors, columns as JJ Variables).

Usage

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

Arguments

Data

a data matrix that can be II rows by JKJ*K columns (when "flat") or IKI*K rows by JJ columns when "long".

shape

(Default: flat when "flat" the data matrix has dimensions II rows by JKJ*K columns; when "long" the data matrix has dimensions IKI*K rows by JJ columns.

nVars

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

nBlocks

(Default = NULL) number of Blocks (i.e., KK) of II 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 II by JJ by KK 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]