xclipHist: Histogram with clipped x axis

View source: R/hist.R

xclipHistR Documentation

Histogram with clipped x axis

Description

Draw histograms with clipped x axis; the clipping is determined by quantiles of x values.

Usage

xclipHist(
  x,
  xclip = c(0.01, 0.99),
  breaks = 100,
  quantiles = 0.25,
  qlty = 2,
  qlwd = 2,
  qcol = "red",
  ...
)

Arguments

x

Value to draw the histogram

xclip

Quantiles of x-values that should be displayed; values outside of this range are not shown in the histogram

breaks

A integer number indicating how many breaks should the original unclipped data have; the function will automatically re-calculate the breaks of the clipped data so that they look consistent.

quantiles

Numeric values or NULL; in case of numeric values, at the corresponding quantile values vertical lines and text labels are drawn; if set to NULL, no extra items will display. See examples below.

qlty

Type of vertical quantile lines

qlwd

Width of vertical quantile lines

qcol

Color of vertical quantile lines

...

Other parameters that are passed to hist

Details

The function clips (subsets) x-axis and recalcualte the breaks so that the clipped image looks like a real subset of the original data.

Value

The object returned by the hist function, with an extra item named quantiles.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

qHist, which draws quantile line and texts onto histograms.

Examples


testVal <- c(rnorm(1000),10)
hist(testVal, breaks=100)
xclipRes <- xclipHist(testVal, xclip=c(0.001, 0.999), quantiles=0.50)

xclipRes$quantiles


bedapub/ribiosPlot documentation built on Sept. 1, 2023, 6:50 p.m.