sort.table: sort.table

Description Usage Arguments Examples

Description

This function allows to sort the input contingency table according to the score of row and column categories on the selected Correspondence Analysis dimension. Two plots are returned, displaying the sorted contingency table. Note that the two plots are the same, except for the fact that one is the transposed version of the other. A battleship plot for the seriated table is also provided. Two tab delimited .txt files are also created in the R working directory, containing the sorted table and the sorted table converted into presence/absence data.

Usage

1
2
## S3 method for class 'table'
sort(data, dim = 1, plot = FALSE, battlshp = FALSE)

Arguments

data:

Dataframe containing the contingency table to be analysed.

dim:

The dimensions (1st default) to be used to sort the contingency table (i.e., to perfom the seriation).

plot:

logic value (TRUE/FALSE); if set to TRUE, two seriation plots (i.e., a Bertin plot) are returned, one the reverse of the other. FALSE is default.

battlshp:

logic value (TRUE/FALSE); if set to TRUE, two 'battleship' plots are returned, one the reverse of the other. FALSE is default.

Examples

1
2
3
data("perfect_seriation"): load the dataset 'perfect_seriation'
sort.table (perfect_seriation,1): sort the contingency table (contained in the 'perfect_seriation' dataframe) according to the score of row and column categories on the 1 dimension of Correspondence Analysis.
sort.table (perfect_seriation,1, plot=TRUE, battlshp=TRUE): sort the contingency table (contained in the 'perfect_seriation' dataframe) according to the score of row and column categories on the 1 dimension of Correspondence Analysis. Seriation plots (Bertin plot) and battleship plots are also returned.

gianmarcoalberti/CAseriation documentation built on May 17, 2019, 4:19 a.m.