row_pcoord: Retrieve Row Principal Coordinates or Column Principal...

Description Usage Arguments Value Examples

Description

The function row_pcoord takes as its input an object of class "ca", and returns the row principal coordinates found in that object. The functions col_pcoord takes as its input an object of class "ca", and returns the column principal coordinates found in that object.

Usage

1
2

Arguments

x

object of class "ca"

...

(not used for the moment)

Value

The function row_pcoord returns a table in which the rows represent the ‘row objects’ from the correspondence analysis, and the columns store the principal coordinates of these ‘row objects’ in the different dimensions of the correspondence analysis solution.

The functions col_pcoord returns a table in which the rows represent the ‘column objects’ from the correspondence analysis, and the columns store the principal coordinates of these 'column objects' in the different dimensions of the correspondence analysis solution.

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
25
26
## traditional biplot, using the basic tools from the
## package ca
data("author") # available from package ca
author_ca <- ca(author)
plot(author_ca)

## alternative plot, using the coordinates retrieved with
## row_pcoord() and col_pcoord()
r_pc <- row_pcoord(author_ca)
c_pc <- col_pcoord(author_ca)
xlim <- xlim4ca(author_ca)     # range of dim 1
ylim <- ylim4ca(author_ca)     # range of dim 2
author_names <- as.factor(gsub("^.*?\\((.*?)\\)$", "\\1",
  rownames(author), perl = TRUE))
plot(r_pc[,1], r_pc[,2], pch = 18, 
     xlim = xlim, ylim = ylim, xlab = "", ylab = "",
     main = "authors and their alphabet",
     col = as.numeric(author_names))
abline(h = 0, col = "gray", lty = 3)
abline(v = 0, col = "gray", lty = 3)
text(c_pc[,1], c_pc[,2], colnames(author), col = "gray")
legend("topright", 
       legend = levels(author_names),  
       pch = rep(18, length(levels(author_names))),
       col = 1:length(levels(author_names)), 
       title = "authors")

wai-wong-reimagine/mclm documentation built on May 16, 2019, 9:12 p.m.