create a base map for CA type graphs with ggplot2
createBaseMap.Rd
createBaseMap
: Create a ggplot2 basemap for CA type graphs.
The final maps are created by using overlays.
A map CA is created with first the baseMap and
then adding a text/dot map.
Usage
createBaseMap(
data,
constraints = NULL,
col.axes = "darkorchid",
alpha.axes = 0.2,
width.axes = 1.1,
col.background = adjustcolor("lavender", alpha.f = 0.2),
title = NULL
)
Arguments
- data
the factor scores to plot
- constraints
a list with minx miny maxx maxy typically obtained from
prettyGraphs::minmaxHelper()
. IfNULL
(default) it is computed with the functionprettyGraphs::minmaxHelper()
.- col.axes
color for the axes, default is
'darkorchid'
.- alpha.axes
alpha parametere (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
adjustcolor('lavender', alpha.f = .2)
.- title
a main title, default is
NULL
(no title)
Important_Note
When creating multiple layers graphs,
because of the way ggplot2
create graphs, all the
the matrices/dataframe should all the have the same column names
e.g., lr1Rm5t5dHrliSziU9dX0VmlZHGUM46A-2- equal to lr1Rm5t5dHrliSziU9dX0VmlZHGUM46A-3-.
When it is not the case, some strange and cryptic
error may be produced
(e.g., "cannot find Dimension"
).