File: boxplot2.R

package info (click to toggle)
gplots 3.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,580 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# $Id: boxplot2.R 2052 2015-06-02 19:03:20Z warnes $

boxplot2  <- function( ..., top=FALSE, shrink=1.0, textcolor=NULL )
  {
    boxcall <- match.call()           # get call
    boxcall$top  <- boxcall$shrink  <- boxcall$textcolor  <- NULL
    boxcall[[1]]  <- as.name("boxplot")

    box <- eval(boxcall, parent.frame())
    mids <- 1:length(box$n)

    if(top)
      {
        where  <- par("usr")[4]
        adj  <- c(0.5,1)
      }
    else
      {
        where  <- par("usr")[3]
        adj  <- c(0.5,0)
      }
    tcex <- par("cex")
    par(cex=shrink*tcex)

    text(x=mids, y=where, labels=paste("n=",box$n,sep=""), adj=adj,
         col=textcolor)

    par(cex=tcex)

    invisible(box)
  }