Skip to contents

createAllMaps4CA: uses ggplot2 to

  1. create all the partial maps for CA with the different types of normalizations: Asymmetric, Symmetric, True-Barycentric, Biplots, and SPSS pseudo Biplots.

to creates ggplot2 factorial maps for dots and labels; 3) to create the base plot maps for CA type graphs, and 4) to creates maps for the \(I\) (rows) and the \(J\) (column) -sets.

Usage

createAllMaps4CA(
  allNormedFactors,
  axis1 = 1,
  axis2 = 2,
  title = NULL,
  col.points.i = "blueviolet",
  alpha.points.i = 0.5,
  pch.i = 19,
  cex.i = 2.5,
  segment.size.i = 0,
  col.labels.i = "darkorchid4",
  alpha.labels.i = 1,
  text.cex.i = 4,
  font.face.i = "bold",
  font.family.i = "sans",
  force.i = 1,
  col.points.j = "darkolivegreen4",
  alpha.points.j = 0.5,
  pch.j = 18,
  cex.j = 2.5,
  segment.size.j = 0,
  col.labels.j = "darkolivegreen",
  alpha.labels.j = 1,
  text.cex.j = 4,
  font.face.j = "bold",
  font.family.j = "sans",
  force.j = 1,
  col.axes = "darkorchid",
  alpha.axes = 0.2,
  width.axes = 1.1,
  col.background = adjustcolor("lavender", alpha.f = 0.2),
  ...
)

Arguments

allNormedFactors,

A list with all the factor scores normed typically from createAllNormedFactors.

axis1

the column of X used for the horizontal axis of the plot. Default = 1.

axis2

the column of X used for the vertical axis of the plot. Default = 2.

title

A main title (default is NULL).

col.points.i

the color of the points/dots for the \(I\)-set. Can be one color or a vector of colors. If a vector, it needs to have exactly the number of items to be plotted. Default = 'blueviolet'.

alpha.points.i

(default = .5), the alpha (transparency) for the points, should be between 1 (opaque) and 0 (completely transparent).

pch.i

the character for the points for the \(I\)-set. Default is 19 (Circles).

cex.i

size of the dots for the \(I\)-set. Default = 2.5

segment.size.i

= 0, # size of segment

col.labels.i

the color of the labels for the \(I\)-set. Can be one color or a vector of colors. If a vector, it needs to have exactly the number of items to be plotted. Default = 'darkorchid'.

alpha.labels.i

(default = 1), the alpha (transparency) for the labels, should be between 1 (opaque) and 0 (completely transparent).

text.cex.i

= 4, font size for labels for the I-set.

font.face.i

(Default = 'bold') font for labels for the \(I\)-set.

font.family.i

(Default = 'sans') font family for the \(I\)-set.

force.i

(Default = 1) How much ggrepel repels the labels for the \(I\)-set.

col.points.j

the color of the points/dots for the \(J\)-set. Can be one color or a vector of colors. If a vector, it needs to have exactly the number of items to be plotted. Default = 'darkolivegreen4'.

alpha.points.j

(Default = .5), the alpha (transparency) for the \(J\)-points, should be between 1 (opaque) and 0 (completely transparent).

pch.j

the character for the points for the \(J\)-set. Default is 18 (Diamonds).

cex.j

size of the dots for the \(J\)-set. Default = 2.5

segment.size.j

= 0, # size of segment for \(J\)-set

col.labels.j

the color of the labels for the \(J\)-set. Can be one color or a vector of colors. If a vector, it needs to have exactly the number of items to be plotted. Default = 'darkolivegreen'.

alpha.labels.j

(default = 1), the alpha (transparency) for the \(J\)-labels, should be between 1 (opaque) and 0 (completely transparent).

text.cex.j

(Default = 4) font size for labels for the \(J\)-set.

font.face.j

(Default = 'bold' font for the labels for the \(J\)-set.

font.family.j

(Default = 'sans') font family for the \(J\)-set.

force.j

(Default = 1). How much ggrepel repels the labels for the \(J\)-set.

col.axes

(Default = 'darkorchid') color for the axes.

alpha.axes

(Default = .2) transparency factor for the color of the axes.

width.axes

(Default = 1.1) the width of the axes

col.background

Default = adjustcolor('lavender', alpha.f = .2), The color of the background.

...

eveythings else for the functions.

Value

a list with baseMap_S: The Background (Symmetric) I_labels_S The labels I-set (Symmetric). I_points_S The dots I-set (Symmetric). J_labels_S The labels J-set (Symmetric). J_points_S The dots J-set(Symmetric). baseMap_A The Background (Asymmetric) I_labels_A The labels I-set (Asymmetric). I_points_A The dots I-set (Asymmetric). J_labels_A The labels J-set (Asymmetric). J_points_A The dots J-set (Asymmetric). baseMap_B The Background (Barycentric). I_labels_B The labels I-set (Barycentric). I_points_B The dots I-set (Barycentric). J_labels_B The labels J-set (Barycentric). J_points_B The dots J-set (Barycentric).

Details

The final maps are built by combining the elementary maps. For example, a map with the \(J\)-set being asymmetric and the \(I\)-set being Symmetric would be made by creating the Ja_Is map as Ja_Is <- baseMap_A + J_labels_A + I_labels_S.

Note than, in general, the Asymmetric is larger than the Symmetric map which is in turn larger than the Barycentric map.

Important_Note

When creating multiple layers graphs, because of the way ggplot2 create graphs, all the matrices/dataframe should all the have the same column names e.g., jB2U5NTSJy7CWf8zaM16G05cmn6fyLsv-2- equal to c("Dimension 1", "Dimension 2"). When this is not the case, some strange and cryptic errors may be produced (e.g., "cannot find Dimension").

See also

createFactorMaps createbaseMap

Author

Hervé Abdi