Repository navigation
Expand file tree
/
Copy pathggpcp.Rd
More file actions
48 lines (42 loc) · 1.42 KB
/
Copy pathggpcp.Rd
File metadata and controls
48 lines (42 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
\name{ggpcp}
\alias{ggpcp}
\title{Make a parallel coordinates plot.}
\usage{
ggpcp(data, vars = names(data), scale = "range", ...)
}
\arguments{
\item{data}{data frame}
\item{vars}{variables to include in parallel coordinates
plot}
\item{scale}{scaling function, one of "range", "var" or
"I"}
\item{...}{other arguments passed on plot creation}
}
\description{
One way to think about a parallel coordinates plot, is as
plotting the data after it has been transformed to gain a
new variable. This function does this using
\code{\link[reshape]{melt}}.
}
\details{
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.
Three different scaling function are available:
\itemize{ \item "range": scale coordinates to have common
range $[0, 1] \item "var": scale coordinates to have mean
0 and variance 1 \item "I": don't scale the coordinates
at all }
}
\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(aes(group=variable))
ggpcp(mtcars, vars=names(mtcars[2:6])) + geom_line()
p <- ggpcp(mtcars, vars=names(mtcars[2:6]))
p + geom_line()
p + geom_line(aes(colour=mpg))
}