myparallel: Produce Parallel Coordinate Plot Imitating ggparcoord

Description Usage Arguments Value Examples

Description

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.

Usage

1
2
3
myparallel(data, columns = 1:ncol(data), groupColumn = NULL,
  jitter = FALSE, jittervariables = NULL, jitterratio = 0.1,
  mapping = NULL, ...)

Arguments

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

Value

returns a ggplot2 object that can be plotted directly or used as base layers for additional modification

Examples

 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")

yaweige/yaweitest documentation built on May 7, 2019, 6:10 a.m.