# NOT RUN {
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)
)
)
)
# }
Run the code above in your browser using DataLab