grpplot: Plot Matrix-Like Object by Group

View source: R/mt_util.R

grpplotR Documentation

Plot Matrix-Like Object by Group

Description

Plot matrix-like object by group

Usage

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

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.

Value

An object of class "trellis".

Author(s)

Wanchang Lin

See Also

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

Examples

  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))))


mt documentation built on June 22, 2024, 12:24 p.m.

Related to grpplot in mt...