ggpcp {ggplot2} | R Documentation

## Parallel coordinates plot.

### Description

Generate a plot ``template'' for a paralell coordinates plot.

### Usage

    ggpcp(data, vars=names(data), scale="range", ...)

### Arguments

`data` | data frame
`vars` | variables to include in parallel coordinates plot
`scale` | scaling function, one of "range", "var" or "I"
`...` | other arguments passed on plot creation

### Details

One way to think about a parallel coordinates plot, is as plotting the data after it has transformation been transformed to gain a new variable. This function does this using `\melt`.

This gives us enormous flexibility as we have separated out the type of drawing (lines by tradition) and can now use any of the existing geom functions. In particular this makes it very easy to create parallel boxplots, as shown in the example.

### Author(s)

Hadley Wickham <h.wickham@gmail.com>

### Examples

    ggpcp(mtcars) + geom_line()
    ggpcp(mtcars, scale="var") + geom_line()
    ggpcp(mtcars, vars=names(mtcars)[3:6], formula= . ~cyl, scale="I") + geom_line()
    ggpcp(mtcars, scale="I") + geom_boxplot()
    ggpcp(mtcars, vars=names(mtcars[2:6])) + geom_line()
    p <- ggpcp(mtcars, vars=names(mtcars[2:6]), formula=.~vs)
    p + geom_line()
    p + geom_line(aes(colour=mpg))

[Package ggplot2 version 0.5.5 Index]