Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

mt (version 2.0-1.20)

grpplot: Plot Matrix-Like Object by Group

Description

Plot matrix-like object by group

Usage

grpplot(x, y, plot = "pairs", ...)

Value

An object of class "trellis".

Arguments

x

A matrix or data frame to be plotted.

y

A factor or vector giving group information of columns of x.

plot

One of plot types: strip, box, density and pairs.

...

Further arguments. See corresponding entry in xyplot for non-trivial details. One argument is ep: an integer for plotting ellipse. 1 and 2 for plotting overall and group ellipse, respectively. Otherwise, none. For details, see panel.elli.1.

Author

Wanchang Lin

See Also

panel.elli.1, pcaplot, pca_plot_wrap, lda_plot_wrap, pls_plot_wrap.

Examples

Run this code
  data(iris)
  grpplot(iris[,1:4], iris[,5],plot="strip", main="IRIS DATA")
  grpplot(iris[,1:4], iris[,5],plot="box", main="IRIS DATA")
  grpplot(iris[,1:4], iris[,5],plot="density", main="IRIS DATA")
  grpplot(iris[,1:4], iris[,5],plot="pairs",main="IRIS DATA",ep=2)

  ## returns an object of  class "trellis".
  tmp <- grpplot(iris[,c(2,1)], iris[,5],main="IRIS DATA",ep=2)
  tmp
  
  ## change symbol's color, type and size
  grpplot(iris[,c(2,1)], iris[,5],main="IRIS DATA", cex=1.5,
         auto.key=list(space="right", col=c("black","blue","red")),
         par.settings = list(superpose.symbol = list(col=c("black","blue","red"),
                                                     pch=c(1:3))))

Run the code above in your browser using DataLab