barplot.wts: barplot.wts

Usage Arguments Examples

Usage

1
barplot.wts(x, legend.text = NULL, col = NULL, ylab = NULL, xlab = NULL, bar.ylim = NULL)

Arguments

x
legend.text
col
ylab
xlab
bar.ylim

Examples

 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
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, legend.text = NULL, col = NULL, ylab = NULL, xlab = NULL, 
    bar.ylim = NULL) 
{
    n = ncol(x)
    p = nrow(x)
    xpos = (abs(x) + x)/2
    xneg = (x - abs(x))/2
    if (is.null(bar.ylim)) {
        ymax <- max(colSums(xpos, na.rm = T))
        ymin <- min(colSums(xneg, na.rm = T))
        ylim = c(ymin, ymax)
    }
    else {
        ylim = bar.ylim
    }
    barplot(xpos, legend.text = legend.text, col = col, ylab = ylab, 
        xlab = xlab, args.legend = list(x = 1.2, y = bar.ylim[2], 
            cex = 0.5), ylim = bar.ylim)
    barplot(xneg, add = T, col = col)
    abline(h = 0)
  }

kecoli/mpo documentation built on May 20, 2019, 8:34 a.m.