invert: Invert the direction of coordinates

Description Usage Arguments Details Value See Also Examples

View source: R/functions_tools.r

Description

Invert one or more axes of a correspondence analysis. The principal coordinates of the analysis are multiplied by -1.

Usage

1
invert(x, dim = 1)

Arguments

x

is a soc.ca object

dim

is the dimensions to be inverted

Details

This is a convieniency function as you would have to modify coord.mod, coord.ind and coord.sup in the soc.ca object.

Value

a soc.ca object with inverted coordinates on the specified dimensions

See Also

soc.mca, add.to.label

Examples

1
2
3
4
example(soc.ca)
inverted.result  <- invert(result, 1:2)
result$coord.ind[1, 1:2]
inverted.result$coord.ind[1, 1:2]

Example output

Loading required package: ggplot2

soc.ca> data(taste)

soc.ca> # Create a data frame of factors containing all the active variables 
soc.ca> taste          <- taste[which(taste$Isup == 'Active'), ]

soc.ca> attach(taste)

soc.ca> active         <- data.frame(TV, Film, Art, Eat)

soc.ca> sup            <- data.frame(Gender, Age, Income)

soc.ca> detach(taste)

soc.ca> # Runs the analysis
soc.ca> result         <- soc.mca(active, sup)
[1] -0.1353094  0.9019845
[1]  0.1353094 -0.9019845

soc.ca documentation built on Sept. 5, 2021, 5:21 p.m.

Related to invert in soc.ca...