Skip to contents

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(). If NULL (default) it is computed with the function prettyGraphs::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)

Value

a basemap

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").

Author

Hervé Abdi

Examples

if (FALSE) {
aBaseMap <- createBaseMap(Fi)
# with Fi being a map of factor scores
}