parallelPlot | R Documentation |
htmlwidget 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 |
data.frame with data to use in the chart. |
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:
equal for each category ( |
arrangeMethod |
Within a category box:
the position of lines can be calculated to minimize crossings on the left of the 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: "Viridis", "Inferno", "Magma", "Plasma", "Warm", "Cool", "Rainbow", "CubehelixDefault",
"Blues","Greens", "Greys", "Oranges", "Purples", "Reds", "BuGn", "BuPu", "GnBu", "OrRd", "PuBuGn","PuBu",
"PuRd", "RdBu", "RdPu", "YlGnBu", "YlGn", "YlOrBr", "YlOrRd";
default value is |
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 |
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(NULL, c(4, 6, 8), NULL, NULL, NULL, NULL, NULL, c(0, 1), c(0, 1), 3:5, 1:8)
parallelPlot(mtcars, categorical = categorical, refColumnDim = "cyl")
# 'cyl' and four last columns have a box representation for its categories
histoVisibility <- rep(TRUE, ncol(iris))
parallelPlot(iris, histoVisibility = histoVisibility)
# An histogram is displayed for each column
histoVisibility <- rep(TRUE, ncol(iris))
cutoffs <- list(list(c(6, 7)), NULL, NULL, NULL, c("virginica", "setosa"))
parallelPlot(iris, histoVisibility = histoVisibility, cutoffs = cutoffs)
# Cut lines are shaded; an histogram 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: white",
".tick text" = c("fill: red", "font-size: 1.8em")
))
# Background of plot is white 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.