ggparci: Parallel Coordinates Plot with Groups medians and their...

Description Usage Arguments Value Examples

View source: R/ggparci.R

Description

The function plots parallel coordinates (gg)plot, in which each line connects the variables medians for each group. Confidence "bands" for the medians are added to each line. This allows the assessment of groups (clusters) separations. The variables are normalized to [0,1] scale prior to plotting.

Usage

1
2
3
4
5
ggparci(data, columns = 1:ncol(data), groups_column, conf_level = 0.95,
  method = c("normalize", "percentize", "none"), title = "",
  groups_in_facets = FALSE, flip_coords = FALSE,
  include_obs_lines = FALSE, alpha_obs_lines = 0.1, alpha_ci_bands = 0.5,
  ...)

Arguments

data

a data.frame. includes the grouping variable

columns

variables to include in the plot, as character vector with columns names or as integer vector with positions. the group variable is ignored, if specified.

groups_column

grouping variable name (quoted)

conf_level

confidence level for the bands, Default: 0.95

method

which normalization method to apply. See normalize (default) and percentize.

title

Plot title, Default: ”

groups_in_facets

logical. plot each group in a separate plot/facet? Default: FALSE

flip_coords

logical. make the coordinates horizontal? Default: FALSE

include_obs_lines

logical. add lines for the rows? Default: FALSE

alpha_obs_lines

transparency factor for the lines, Default: 0.1

alpha_ci_bands

transparency factor for the confidence bands, Default: 0.5

...

additional arguments to the plot

Value

a ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 

ggparci(iris, groups_column = "Species", method = "none")
ggparci(iris, groups_column = "Species", method = "normalize")
ggparci(iris, groups_column = "Species", method = "percentize")

#select only some of the variables
# plot a line for each observation
# and dont plot the CIs
ggparci(iris,columns = 1:3, groups_column = "Species", include_obs_lines = T, alpha_ci_bands = 0)

# display each group in a different facet
ggparci(iris, groups_column = "Species", groups_in_facets = T)

# flip the plot
ggparci(iris, groups_column = "Species", flip_coords = T)


## End(Not run)

HBPMedical/ggparci documentation built on May 28, 2019, 12:40 p.m.