pacoplot: Parallel Coordinates Plot for Clustering

Description Usage Arguments Details Examples

Description

Creates an interactive parallel coordinates plot detailing each dimension and the cluster associated with each observation.

Usage

1
2
3
pacoplot(data, clusters, colorScheme = "schemeCategory10",
  width = NULL, height = NULL, labelSizes = NULL, lineSize = NULL,
  measures = NULL)

Arguments

data

A dataframe of numeric columns.

clusters

A named integer matrix of clusters where names are the row names of the above dataframe and integers are the integer value of the row's associated cluster. This can be obtained from a function such as stats::kmeans()$cluster .

colorScheme

The color scheme of the plot. May be a pre-configured D3 ordinal color scheme or a vector of html colors (hex or named) of the same length as the number of clusters.

width

The width of the plot window.

height

The height of the plot window.

labelSizes

A number or list of any combination of parameters shown that define the label sizes. list(yaxis = 12, yticks = 10, tooltip = 15)

lineSize

A number to adjust the size of the lines.

measures

A list of functions that is any combination of parameters shown that define the measurements for intervals and average lines displayed. Defaults to the options shown (median and 1st and 3rd quartile).
list(avg = median, upper = function(x){return(quantile(x, c(0.75)))}, lower = function(x){return(quantile(x, c(0.25)))})

Details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Barebones
df <- state.x77
clus <- kmeans(df, 5)$cluster
pacoplot(data = df, clusters = clus)

# With options
df <- state.x77
clus <- kmeans(df, 5)$cluster
pacoplot(data = df, clusters = clus,
         colorScheme = c("red", "green", "orange", "blue", "yellow"),
         labelSizes = list(yaxis = 16, yticks = 12),
         measures = list(avg = mean))

klustR documentation built on June 19, 2019, 5:03 p.m.