gap.barplot: gap.barplot function

Description Usage Arguments Details Value Author(s) Examples

View source: R/gap.barplot.R

Description

Bar plot with/without gaps

Usage

 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
gap.barplot(
  df,
  y.cols = 1:ncol(df),
  sdu.cols = NULL,
  sdd.cols = NULL,
  btm = NULL,
  top = NULL,
  ylim = NULL,
  yext = 1.05,
  min.range = 10,
  max.fold = 5,
  ratio = 1,
  gap.width = 1,
  brk.side = 2,
  brk.type = "normal",
  brk.bg = "white",
  brk.srt = 135,
  brk.size = 1,
  brk.col = "black",
  brk.lwd = 1,
  error.cex = 1,
  error.lwd = 1,
  error.col = 1,
  sig.lab = NULL,
  sig.cex = 1,
  sig.xpos = 0.5,
  sig.ypos = -2,
  box.lwd = 1,
  box.col = 1,
  box.lty = 1,
  ...
)

Arguments

df

long format of data.frame, grouped by columns

y.cols

columns for y

sdu.cols
sdd.cols
btm

bottom of gap

top

top of gap

ylim
yext

extension of y axis

min.range

min ratio of max to min value, for automated calculation of gap

max.fold

max ratio of max to bottom of gap, for automated calculation of gap.

ratio

top to bottom spanning ratio

gap.width
brk.side

if brk.size=1, set breaks on left only

brk.type

normal or zigzag

brk.bg
brk.srt

rotation angle of break ticks

brk.size
brk.col
brk.lwd
error.cex
error.lwd
error.col
sig.lab
sig.cex
sig.xpos
sig.ypos
box.lwd
box.col
box.lty
...

to barplot function

Details

Set gap for barplot automatically or by btm and top pars.

Value

x value of bars

Author(s)

ZG Zhao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Begin example
library(Xtools)
datax <- na.omit(airquality)[,1:4]
cols <- cm.colors(ncol(datax))
layout(matrix(1:6, ncol=2))
set.seed(0)
for (ndx in 1:6){
    dt <- datax[sample(rownames(datax), 10), ]
    par(mar=c(0.5,2,0.5,0.5))
    brkt <- sample(c('normal', 'zigzag'), 1)
    gap.barplot(dt, col=cols, brk.type=brkt, max.fold=5, ratio=2)
}
## End example

zgzhao/Xtools documentation built on May 22, 2021, 3:37 a.m.