addCircleOfCor.ptca: Add a Circle of Correlation to a PCA-like map of correlation...

View source: R/addCircleOfCor.R

addCircleOfCor.ptcaR Documentation

Add a Circle of Correlation to a PCA-like map of correlation produced by createFactorMap() et alia.

Description

addCircleOfCor.ptca: Add a Circle of Correlation to a PCA-like map of correlation produced by createFactorMap et alia.

Usage

addCircleOfCor.ptca(
  color = "darkorchid",
  alpha = 0.3,
  size = 1,
  center = c(0, 0),
  radius = 1,
  nPoints = 100
)

Arguments

color

(Default: 'darkorchid') color for the circle.

alpha

(Default: 0.3) transparency for the circle, should be between 0 (completely transparent) and 1 (no transparent).

size

(Default: 1) thickness of the line of the circle.

center

(Default: c(0, 0)) center of the circle.

radius

(Default: 1) radius of the circle.

nPoints

(Default: 100) the number of points used to draw the circle.

Details

The map should should be first created by, for example, createFactorMap() (or equivalent functions from PTCA4CATA), and then the circle of correlation is added (see example).

Note: The lastest version of this function is in the other package data4PCCAR (under the name addCircleOfCor).

Value

nothing

Author(s)

Hervé Abdi

See Also

createFactorMap

Examples

# Some PCA-like correlations
corXY <- matrix(c(.5,-.5, .1,.7, .8,.5, -.1,.9,  -.6,-.6),
               ncol = 2, byrow = TRUE )
# create a map of correlation
MapCor <- createFactorMap(corXY,
         constraints = list(minx = -1, miny = -1,
                            maxx = 1 , maxy = 1) )
# Add a circle to the base Map
ggMapWithCircle <- MapCor$zeMap  + addCircleOfCor.ptca()
# To print the map with the circle:
# print(ggMapWithCircle)

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