guided_pcp | R Documentation |
Draws a parallel coordinate plot, with an accompanying barchart showing an index (eg correlation, scagnostics) levels for each panel. An index legend is optional.
guided_pcp(data, edgew=NULL, path = NULL, pathw=NULL,zoom=NULL,pcpfn=pcp, pcp.col = 1,lwd=0.5, panel.colors=NULL, pcp.mar=c(1.5,2,2,2), pcp.scale=TRUE, bar.col=1:9,bar.axes=FALSE, bar.mar=NULL,bar.ylim=NULL, reorder.weights=TRUE, layout.heights=NULL, layout.widths=c(10,1), main=NULL,legend=FALSE,cex.legend = 1,legend.mar=c(1,4,1,1),...)
data |
A data frame or matrix. |
edgew |
Matrix (or vector) whose rows give index values for each pair of variables. |
path |
an index vector specifying variable order, or a function. If a function, |
pathw |
Matrix (or vector) whose rows give index values for each adjacent pair of variables in path. Usually this argument is NULL and |
zoom |
If provided, a numeric vector specifying a subsequence of path to display. |
pcpfn |
Function to draw the parallel coordinates. |
pcp.col |
Line colors. |
lwd |
Line widths. |
panel.colors |
Background panel colors, passed to the |
pcp.mar |
Controls PCP margin size. |
pcp.scale |
If TRUE, the variables will be scaled to 0-1 range, otherwise the data is not scaled. |
bar.col |
Bar colors. |
bar.axes |
Draw barplot axes, if TRUE. |
bar.mar |
Controls barplot margin size. |
bar.ylim |
Vertical limits of bar plot. |
reorder.weights |
If TRUE, reorder barplot indices so large values are drawn at the bottom. |
layout.heights |
Controls the layout. |
layout.widths |
Controls the layout. |
main |
Main title for PCP. |
legend |
If TRUE, draws the barplot index legend. |
cex.legend |
Controls legend text size. |
legend.mar |
Legend margin size. |
... |
Optional arguments |
C.B. Hurley and R.W. Oldford
see overview
pcp
,catpcp
require(PairViz) data <- mtcars[,c(1,3:6)] cols <- c("red","green")[mtcars[,9]+1 ] # transmission type, red=automatic # add a correlation guide and find "better" hamiltonians... # add a correlation guide... corw <- dist2edge(as.dist(cor(data))) edgew <- cbind(corw*(corw>0), corw*(corw<0)) # add a correlation guide to a PCP, positive cors shown in blue, negative in purple... ## Not run: dev.new(width=3,height=3) par(cex.axis=.65) guided_pcp(data,edgew, pcp.col=cols, main="Correlation guided PCP",bar.col = c("blue","purple")) dev.new(width=7,height=3) par(cex.axis=.65) guided_pcp(data,edgew, path=eulerian, pcp.col=cols,lwd=2, main="Correlation guided Eulerian PCP",bar.col = c("blue","purple"),bar.axes=TRUE) ## End(Not run) # Scagnostic guides are useful here- see the demos for more examples.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.