Create interactive parallel coordinates charts with this htmlwidget wrapper for d3.js parallel-coordinates.
parcoords(data = NULL, rownames = TRUE, color = NULL, brushMode = NULL, brushPredicate = "and", alphaOnBrushed = NULL, reorderable = FALSE, axisDots = NULL, margin = NULL, composite = NULL, alpha = NULL, queue = FALSE, mode = FALSE, rate = NULL, dimensions = NULL, bundleDimension = NULL, bundlingStrength = 0.5, smoothness = 0, tasks = NULL, autoresize = FALSE, withD3 = FALSE, width = NULL, height = NULL, elementId = NULL)
data | data.frame with data to use in the chart |
---|---|
rownames | logical use rownames from the data.frame in the chart. Regardless of
this parameter, we will append rownames to the data that we send to JavaScript.
If |
color | Color can be a single color as rgb or hex. For a color function,
provide a
|
brushMode | string, either |
brushPredicate | string, either |
alphaOnBrushed | opacity from 0 to 1 when brushed (default to 0). |
reorderable | logical enable reordering of axes |
axisDots | logical mark the points where polylines meet an axis with dots |
margin | list of sizes of margins in pixels. Currently
|
composite | foreground context's composite type |
alpha | opacity from 0 to 1 of the polylines |
queue | logical (default FALSE) to change rendering mode to queue for
progressive rendering. Usually |
mode | string see |
rate | integer rate at which render will queue |
dimensions |
|
bundleDimension | character string for the column or variable on which to bundle |
bundlingStrength | numeric value between 0 and 1 for the strength of the bundling. This value will
not affect the parallel coordinates if |
smoothness | numeric value between between 0 and 1 for stength of smoothing or curvature. This value will
not affect the parallel coordinates if |
tasks | a character string or |
autoresize | logical (default FALSE) to auto resize the parcoords when the size of the container changes. This is useful in contexts such as rmarkdown slide presentations or flexdashboard. However, this will not be useful if you expect bigger data or a more typical html context. |
withD3 |
|
width | integer in pixels defining the width of the widget. Autosizing to 100
of the widget container will occur if |
height | integer in pixels defining the height of the widget. Autosizing to 400px
of the widget container will occur if |
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()) { # simple example using the mtcars dataset data( mtcars ) parcoords( mtcars ) # various ways to change color # in these all lines are the specified color parcoords( mtcars, color = "green" ) parcoords( mtcars, color = "#f0c" ) # in these we supply a function for our color parcoords( mtcars , color = list( colorBy = "cyl" , colorScale = "scaleOrdinal" , colorScheme = "schemeCategory10" ) , withD3 = TRUE ) if(require('ggplot2', quietly = TRUE)) { parcoords( diamonds ,rownames = FALSE ,brushMode = "1d-axes" ,reorderable = TRUE ,queue = TRUE ,color= list( colorBy="cut" , colorScale = "scaleOrdinal" , colorScheme = "schemeCategory10" ) ,withD3 = TRUE ) } } library(parcoords) parcoords( mtcars, dimensions = list( cyl = list( title = "cylinder", tickValues = unique(mtcars$cyl) ) ) ) parcoords( mtcars ,rownames = FALSE ,brushMode = "1d-multi" ,brushPredicate = "OR" ,dimensions = list( cyl = list( title = "cylinder", tickValues = unique(mtcars$cyl) ) ) )