grpplot: Plot Matrix-Like Object by Group

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mt_util.R

Description

Plot matrix-like object by group

Usage

1
  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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  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 Feb. 2, 2022, 1:07 a.m.

Related to grpplot in mt...