add.to.label: Add values to label

View source: R/functions_label.r

add.to.labelR Documentation

Add values to label

Description

Adds values to the end of the label of each modality.

Usage

add.to.label(object, value = "freq", prefix = "default", suffix = ")", dim = 1)

Arguments

object

is a soc.ca object

value

the type of values added to the labels. "freq" adds frequencies, "mass" adds mass values to the active modalities, "ctr" adds contribution values to the active modalities, "cor" adds correlation values. value also accepts any vector with the length of the number of active modalities. "linebreak" adds a linebreak \n after the first ":" in the label.

prefix

if "default" an appropriate prefix is used

suffix

the suffix

dim

the dimension from which values are retrieved

Value

a soc.ca object with altered labels in names.mod and names.sup

Examples

example(soc.ca)
result.label  <- add.to.label(result)
result.label$names.mod
result.label  <- add.to.label(result, value = "ctr", dim = 2)
result.label$names.mod
result.label  <- add.to.label(result, value = result$variable, prefix = " - ", suffix = "")
result.label$names.mod
result.label  <- add.to.label(result, value = "linebreak")
result.label$names.mod
map.ctr(result.label)

Rsoc/soc.ca documentation built on March 7, 2024, 8:59 p.m.