Description Usage Arguments Value Examples
This function produce parallel coordinate plot pretty much like GGally::ggparcoord. It supports color and jitter, and some straight forward modifications from ggplot2. But some functionalities are under work.
1 2 3 |
data |
the data.frame to plot |
columns |
a vector of variables (either names or indices) to be axes in the plot |
groupColumn |
a single variable to group (color) by |
jitter |
a single logical value, jitter the points of the selected varaible(s) or not |
jittervariables |
varibles that will be jittered, should be a subset of columns, both indices or names; if unspecified, all of the variables will be jittered |
jitterratio |
the ratio of the maximum random ajustment devided by the range of selected variables (after scaling) |
mapping |
NOT AVAILABLE NOW, aes string to pass to ggplot2 object |
... |
NOT AVAILABLE NOW, passed on directly to all of the ggplot2 commands |
returns a ggplot2 object that can be plotted directly or used as base layers for additional modification
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # use sample of the diamonds data for illustrative purposes
data(diamonds, package="ggplot2")
diamonds.samp <- diamonds[sample(1:dim(diamonds)[1], 100), ]
# default use
myparallel(data = diamonds.samp, columns = c(1, 5:7))
# add color
myparallel(data = diamonds.samp, columns = c(1, 5:7), groupColumn = "cut")
# jitter and title
myparallel(data = diamonds.samp, columns = c(1, 5:7), groupColumn = "cut",
jitter = TRUE, jittervariables = "table") +
ggplot2::ggtitle("hello parallel")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.