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

View source: R/addCircleOfCor.R

addCircleOfCorR Documentation

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

Description

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

Usage

addCircleOfCor(
  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).

Value

nothing

Author(s)

Herve Abdi

See Also

createFactorMap

Examples

## Not run: 
# 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 <- PTCA4CATA::createFactorMap(corXY,
         constraints = list(minx = -1, miny = -1,
                            maxx = 1 , maxy = 1) )
# Add a circle to the base Map
ggMapWithCircle <- MapCor$zeMap  + addCircleOfCor()
# To print the map with the circle:
# print(ggMapWithCircle)

## End(Not run)

HerveAbdi/data4PCCAR documentation built on July 20, 2024, 7:52 a.m.