change_cata_format2 {ClustBlock} | R Documentation |
Change format of CATA datasets to perform the package functions
Description
CATATIS and CLUSCATA operate on data where the blocks of variables are merged horizontally. If you have a vertical format, you can use this function to change the format. The first column must contain the sessions, the second the subjects, the third the products and the others the attributes. If you don't have sessions, then the first column must contain the subjects and the second the products. Unlike change_cata_format function, you can enter data with sessions and/or mixed data in terms of products/subjects. However, you have to set columns to indicate this beforehand.
Usage
change_cata_format2(Data, nprod, nattr, nsub, nsess)
Arguments
Data |
data frame or matrix. Correspond to your data |
nprod |
integer. Number of products |
nattr |
integer. Number of attributes |
nsub |
integer. Number of subjects. |
nsess |
integer. Number of sessions |
Value
The arranged data for CATATIS and CLUSCATA function and the subjects names in the correct order.
See Also
catatis
, cluscata
, change_cata_format
Examples
#Vertical format with sessions
data("fish")
chang=change_cata_format2(fish, nprod= 6, nattr= 27, nsub = 12, nsess= 3)
res.cat2=catatis(Data= chang$Datafinal, nblo = 12, NameBlocks = chang$NameSub)
#Vertical format without sessions
Data=fish[1:66,2:30]
chang2=change_cata_format2(Data, nprod= 6, nattr= 27, nsub = 11, nsess= 1)
res.cat3=catatis(Data= chang2$Datafinal, nblo = 11, NameBlocks = chang2$NameSub)
res.clu3=cluscata(Data= chang2$Datafinal, nblo = 11, NameBlocks = chang2$NameSub)