CAdist | R Documentation |
Perform a correspondence analysis on a contingency table and then return the distance matrix of the coordinates (you can choose the number of axes to use to build the distance matrix with the nCP parameter).
CAdist(df, nPC = NULL, graph = TRUE)
df |
Data.frame, matrix or table with the data for the correspondence analysis. |
nPC |
Number of principal components to be retained for the construction of the distance matrix. Must be between 1 and the minimum of ncol - 1 and nrow - 1. Could also be "max". |
graph |
Logical parameter for plotting the Correspondence Analysis (Axis1, Axis2). |
D |
The distance matrix |
A. COULON
L. BELLANGER
P. HUSI
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
library(SPARTAAS)
data(datangkor)
## contingency table
cont <- datangkor$contingency
distance <- CAdist(cont, nPC = "max")
distance
## run without printing the plot
distance <- CAdist(cont, nPC = "max", graph=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.