View source: R/CreateFactorMaps4CA.R
map4DotsAndLabels | R Documentation |
ggplot2
factorial maps for dots and labels.
NB needs a base map to work correctlymap4DotsAndLabels
:
Creates ggplot2
factorial map for dots and labels.
NB: needs a base map to work correctly.
create the base plot maps for CA type graphs with ggplot2
map4DotsAndLabels( data, axis1 = 1, axis2 = 2, display.points = TRUE, col.points = "blueviolet", alpha.points = 0.5, pch = 19, cex = 2.5, display.labels = TRUE, col.labels = "darkorchid4", alpha.labels = 1, force = 1, segment.size = 0, text.cex = 4, font.face = "bold", font.family = "sans", nudge_x = 0, nudge_y = 0, ... )
data |
the factor scores to plot |
axis1 |
the column of X used for the horizontal axis
of the plot. |
axis2 |
the column of |
display.points |
if |
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.
|
alpha.points |
|
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 labels, should be between 1 (no transparency) and 0 (completely transparent). |
force |
= 1. How much |
segment.size |
= 0,
size of segment line for |
text.cex |
= 4, font size for labels. |
font.face |
(default = |
font.family |
(default = |
nudge_x |
(default = 0). From |
nudge_y |
(default = 0). From |
... |
everything else to pass to the functions |
a list with 6-elements:
zeMap
: The Complete Map (background Dots and Labels);
zeMap_background
: The Background map;
zeMap_dots:
The dots;
zeMap_text:
The Labels;
factorScores:
The factor scores; and
constraints:
The list of the contraints
(could be used to generate other graphs
with the same scaling factors).
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"
).
Herve Abdi
createFactorMap
createBaseMap
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.