Learn R Programming

extracat (version 1.6-3)

cpcp: Parallel Coordinates Plot for categorical data

Description

This function provides a parallel coordinates plot for categorical as well as continuous data based on the ipcp function in the iplots package. It applies sorted numeric point sequences to the categories which indicate the relative frequencies and allow a sensible interactive highlighting. There are options to change the rule for the gaps between these sequences and to apply an additional ordering algorithm.

Usage

cpcp(x,...)
## S3 method for class 'table':
cpcp(
x,ord = NULL, freqvar = NULL,numerics = NULL, gap.type = "equal.tot",
na.rule = "omit", spread=0.3,gap.space = 0.2, sort.individual=FALSE, 
jitter = FALSE, plot = TRUE, return.df = !plot,\dots)

## S3 method for class 'default': cpcp( x,ord = NULL, freqvar = NULL,numerics = NULL, gap.type = "equal.tot", na.rule = "omit", spread=0.3,gap.space = 0.2, sort.individual=FALSE, jitter = FALSE, plot = TRUE, return.df = !plot,\dots)

Arguments

x
data frame containing the variables for the plot. A special choice and order can be made by setting the second argument ord.If V is a frequency table (see e.g. ftable) the frequency variabl
freqvar
Optional name of a frequency variable in V. If V contains a variable called "Freq" (see ftable) it will be defined as frequency variable if freqvar is un
numerics
An integer vector specifying the indices of numeric variables. Variables of class "numeric" are indicated automatically but integer variables are not.
ord
An integer vector specifying the indices and order of the variables.
gap.type
The rule for the gaps between different categories: "equal.gaps" will lead to equal gap sizes in the whole plot (and thus depends on the maximum number of categories). "equal.tot" will force the gaps within each variable to sum
na.rule
"omit" will omit all incomplete cases from V. Otherwise all NAs will be transformed to categories called "n/a".
spread
The maximum width of a single category if gap.type is set to "spread". Should lie between 0 and 1.
gap.space
The space parameter for each gap. Should lie in $[0,1)$.
sort.individual
If TRUE all polygones with the same categories in two neighboring variables will be drawn together in the right variable.
jitter
logical: whether or not to jitter integer variables which are treated as a numeric variable.
plot
Whether or not to draw the plot. If FALSE only the iset is computed.
return.df
A logical indicating whether or not to return the iset.
...
Further arguments.

Value

  • invisible(TRUE) or, if return.df == TRUE, the iset which was computed.

References

Alexander Pilhoefer, Antony Unwin (2013). New Approaches in Visualization of Categorical Data: R Package extracat. Journal of Statistical Software, 53(7), 1-25. URL http://www.jstatsoft.org/v53/i07/

See Also

ipcp listen resort

Examples

Run this code
cpcp(x = housing)

A <- arsim(1000,c(4,8,12,16),4, noise = 0.05)
cpcp(A, sort.individual = TRUE)

A2 <- optile(A)
cpcp(A2, sort.individual = TRUE)

Run the code above in your browser using DataLab