scatterPlotMatrix {scatterPlotMatrix} | R Documentation |
htmlwidget for d3.js scatter plot matrix
Description
htmlwidget for d3.js scatter plot matrix
Usage
scatterPlotMatrix(
data,
categorical = NULL,
inputColumns = NULL,
cutoffs = NULL,
keptColumns = NULL,
zAxisDim = NULL,
distribType = 2,
regressionType = 0,
corrPlotType = "Circles",
corrPlotCS = NULL,
rotateTitle = FALSE,
columnLabels = NULL,
continuousCS = "Viridis",
categoricalCS = "Category10",
eventInputId = NULL,
controlWidgets = FALSE,
cssRules = NULL,
plotProperties = NULL,
slidersPosition = NULL,
width = NULL,
height = NULL,
elementId = NULL
)
Arguments
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 |
inputColumns |
List of boolean (one for each data column), |
cutoffs |
List of 'SpCutoff'; a 'SpCutoff' is a list defining a 'xDim', 'yDim' and a list of 'xyCutoff';
a 'xyCutoff' is a pair of 'cutoff' (one for x axis, one for y axis);
a 'cutoff' is a list containing two values (min and max values)
or |
keptColumns |
List of boolean (one for each data column), |
zAxisDim |
Name of the column represented by z axis (used to determine the color to attribute to a point);
|
distribType |
Binary code indicating the type of distribution plot (bit 1: density plot, bit 2: histogram). |
regressionType |
Binary code indicating the type of regression plot (bit 1: linear, bit 2: loess). |
corrPlotType |
String indicating the type of correlation plots to use.
Supported values: |
corrPlotCS |
Name of the color Scale to use for correlation plot when plot type is 'Text' or 'AbsText';
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 |
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 occured, reactive input to write to; |
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. |
plotProperties |
Adjust some properties which can not be set through CSS (mainly size, color and opacity of points).
Default value is |
slidersPosition |
Set initial position of sliders, specifying which columns intervals are 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 |
Examples
if(interactive()) {
library(scatterPlotMatrix)
scatterPlotMatrix(iris, zAxisDim = "Species")
# Each point has a color depending of its 'Species' value
categorical <- list(NULL, c(4, 6, 8), NULL, NULL, NULL, NULL, NULL, c(0, 1), c(0, 1), 3:5, 1:8)
scatterPlotMatrix(mtcars, categorical = categorical, zAxisDim = "cyl")
# 'cyl' and four last columns have a box representation for its categories
# (use top slider to see the last three columns)
scatterPlotMatrix(iris, zAxisDim = "Species", distribType = 1)
# Distribution plots are of type 'density plot' (instead of histogram)
scatterPlotMatrix(iris, zAxisDim = "Species", regressionType = 1)
# Add linear regression plots
columnLabels <- gsub("\\.", "<br>", colnames(iris))
scatterPlotMatrix(iris, zAxisDim = "Species", columnLabels = columnLabels)
# Given names are displayed in place of dataset column names; <br> is used to insert line breaks
scatterPlotMatrix(iris, cssRules = list(
".jitterZone" = "fill: pink",
".tick text" = c("fill: red", "font-size: 1.8em")
))
# Background of plot is pink and text of axes ticks is red and greater
scatterPlotMatrix(iris, plotProperties = list(
noCatColor = "DarkCyan",
point = list(
alpha = 0.3,
radius = 4
)
))
# Points of plots are different:
# two times greater, with opacity reduced from 0.5 to 0.3, and a 'DarkCyan' color
}