View source: R/CreateFactorMaps4CA.R
createFactorMap | R Documentation |
ggplot2
.createFactorMap
:
Creates the ggplot2
basic factor maps for CA type graphs.
The final maps are created by using overlays on top of the base map.
A map for CA is created with the baseMap to which
is added text/dot map.
createFactorMap
calls the functions map4DotsAndLabels
and createBaseMap
.
createFactorMap( X, axis1 = 1, axis2 = 2, constraints = NULL, title = NULL, col.points = "blueviolet", alpha.points = 0.5, display.points = TRUE, pch = 19, cex = 2.5, display.labels = TRUE, col.labels = "darkorchid4", alpha.labels = 1, text.cex = 4, font.face = "bold", font.family = "sans", col.axes = "darkorchid", alpha.axes = 0.2, width.axes = 1.1, col.background = adjustcolor("lavender", alpha.f = 0.2), force = 1, segment.size = 0, ... )
X |
the factor scores to plot. |
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. |
constraints |
a list with |
title |
A title for the graph. Default is |
col.points |
the color of the points/dots.
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 = |
alpha.points |
(default = .5), the alpha (transparency) for the points, should be between 1 (opaque) and 0 (completely transparent). |
display.points |
if |
pch |
the character for the points, Default is 19 (circles). |
cex |
size of the dots. Default = 2.5 |
display.labels |
if |
col.labels |
the color of the labels
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 = |
alpha.labels |
(default = 1), the alpha (transparency) for the points, should be between 1 (no transparency) and 0 (completely transparent). |
text.cex |
= 4, font size for labels. |
font.face |
(Default = |
font.family |
(Default = |
col.axes |
color for the axes, default is
|
alpha.axes |
alpha parameter (transparency) for the axes, default is .2. |
width.axes |
the width of the axes, default is 1.1. |
col.background |
the color theme of the background,
default is |
force |
|
segment.size |
|
... |
stuff to be passed to other functions. |
a list with 6 elements:
zeMap
: The Complete Map (background Dots and Labels);
zeMap_background
: The Background;
zeMap_dots:
: The dots;
zeMap_text:
: The Labels;
factorScores:
: The factor scores; and
constraints:
: The list of the contraints'
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., colnames()
equal to
c("Dimension 1", "Dimension 2")
].
When it is not the case, some strange and cryptic
error may be produced
(e.g., "cannot find Dimension"
).
Hervé Abdi
map4DotsAndLabels
createBaseMap
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.