createBaseMap: create a base map for CA type graphs with ggplot2

View source: R/CreateFactorMaps4CA.R

createBaseMapR Documentation

create a base map for CA type graphs with ggplot2

Description

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

Author(s)

Hervé Abdi

See Also

createFactorMapIJ

Examples

## Not run: 
aBaseMap <- createBaseMap(Fi)
# with Fi being a map of factor scores

## End(Not run)

HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.