parallelPlot | R Documentation |
htmlwidget
for d3.js
parallel coordinate plothtmlwidget
for d3.js
parallel coordinate plot
parallelPlot(
data,
categorical = NULL,
categoriesRep = "EquallySpacedLines",
arrangeMethod = "fromRight",
inputColumns = NULL,
keptColumns = NULL,
histoVisibility = NULL,
invertedAxes = NULL,
cutoffs = NULL,
refRowIndex = NULL,
refColumnDim = NULL,
rotateTitle = FALSE,
columnLabels = NULL,
continuousCS = "Viridis",
categoricalCS = "Category10",
eventInputId = NULL,
editionMode = "EditionOff",
controlWidgets = FALSE,
cssRules = NULL,
sliderPosition = NULL,
width = NULL,
height = NULL,
elementId = NULL
)
data |
|
categorical |
List of list (one for each data column) containing the name of available categories,
or |
categoriesRep |
Within a category column, the height assigned to each category can either be:
|
arrangeMethod |
Within a category box:
|
inputColumns |
List of boolean (one for each data column),
|
keptColumns |
List of boolean (one for each data column), |
histoVisibility |
List of boolean (one for each data column), |
invertedAxes |
List of boolean (one for each data column), |
cutoffs |
List of list (one for each data column) of list (one for each cutoff)
containing two values (min and max values defining the cutoff)
or |
refRowIndex |
Index of the sample row which has to appear horizontal;
|
refColumnDim |
Name of the reference column (used to determine the color to attribute to a row);
|
rotateTitle |
|
columnLabels |
List of string (one for each data column) to display in place of column name found in data,
or |
continuousCS |
Name of the color Scale to use for continuous data;
supported names: |
categoricalCS |
Name of the color Scale to use for categorical data;
supported names: Category10, Accent, Dark2, Paired, Set1;
default value is |
eventInputId |
When plot event occurred, reactive input to write to;
|
editionMode |
Supported edition modes: |
controlWidgets |
Tells if some widgets must be available to control plot;
|
cssRules |
CSS rules to add. Must be a named list of the form list(selector = declarations), where selector is a valid CSS selector and declarations is a string or vector of declarations. |
sliderPosition |
Set initial position of slider, specifying which columns interval is visible.
Default value is list( dimCount = 8, startingDimIndex = 1 ) |
width |
Integer in pixels defining the width of the widget. |
height |
Integer in pixels defining the height of the widget. |
elementId |
Unique |
An object of class htmlwidget
that will intelligently print itself into HTML
in a variety of contexts including the R console, within R Markdown documents,
and within Shiny output bindings.
if(interactive()) {
library(parallelPlot)
categorical <-
list(cyl = c(4, 6, 8), vs = c(0, 1), am = c(0, 1), gear = 3:5, carb = 1:8)
parallelPlot(mtcars, categorical = categorical, refColumnDim = "cyl")
# `cyl` and four last columns have a box representation for categories
histoVisibility <- rep(TRUE, ncol(iris))
parallelPlot(iris, histoVisibility = histoVisibility)
# An histogram is displayed for each column
histoVisibility <- names(iris) # Same as `rep(TRUE, ncol(iris))`
cutoffs <- list(Sepal.Length = list(c(6, 7)), Species = c("virginica", "setosa"))
parallelPlot(iris, histoVisibility = histoVisibility, cutoffs = cutoffs)
# Cut lines are shaded;
# an histogram for each column is displayed considering only kept lines
parallelPlot(iris, refRowIndex = 1)
# Axes are shifted vertically in such a way that first trace
# of the dataset looks horizontal
columnLabels <- gsub("\\.", "<br>", colnames(iris))
parallelPlot(iris, refColumnDim = "Species", columnLabels = columnLabels)
# Given names are displayed in place of dataset column names;
# <br> is used to insert line breaks
parallelPlot(iris, cssRules = list(
"svg" = "background: #C2C2C2",
".tick text" = c("fill: red", "font-size: 1.8em")
))
# Background of plot is grey and text of axes ticks is red and greater
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.