get_ca: Extract the results for rows/columns - CA

Description Usage Arguments Value Author(s) References Examples

View source: R/get_ca.R

Description

Extract all the results (coordinates, squared cosine, contributions and inertia) for the active row/column variables from Correspondence Analysis (CA) outputs.

Usage

1
2
3
4
5
get_ca(res.ca, element = c("row", "col"))

get_ca_col(res.ca)

get_ca_row(res.ca)

Arguments

res.ca

an object of class CA [FactoMineR], ca [ca], coa [ade4]; correspondence [MASS].

element

the element to subset from the output. Possible values are "row" or "col".

Value

a list of matrices containing the results for the active rows/columns including :

coord

coordinates for the rows/columns

cos2

cos2 for the rows/columns

contrib

contributions of the rows/columns

inertia

inertia of the rows/columns

Author(s)

Alboukadel Kassambara alboukadel.kassambara@gmail.com

References

http://www.sthda.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Install and load FactoMineR to compute CA
# install.packages("FactoMineR")
 library("FactoMineR")
 data("housetasks")
 res.ca <- CA(housetasks, graph = FALSE)
 
# Result for column variables
 col <- get_ca_col(res.ca)
 col # print
 head(col$coord) # column coordinates
 head(col$cos2) # column cos2
 head(col$contrib) # column contributions
 
# Result for row variables
 row <- get_ca_row(res.ca)
 row # print
 head(row$coord) # row coordinates
 head(row$cos2) # row cos2
 head(row$contrib) # row contributions
 
 # You can also use the function get_ca()
 get_ca(res.ca, "row") # Results for rows
 get_ca(res.ca, "col") # Results for columns
 

factoextra documentation built on April 2, 2020, 1:09 a.m.