histv | R Documentation |
histv
creates one or more vertically aligned histograms,
rendered by hist
. This is useful for visual
comparison of several numeric vectors.
histv(..., setup = TRUE,
setupDev = NULL,
ylimFixed = FALSE,
col = NULL, border = NULL,
main = NULL, xlab = NULL,
callback = NULL,
debug = FALSE)
... |
one or more numeric vectors to compare |
setup |
if TRUE, graphic device will be set up to hold
enough subfigures. If FALSE, no |
setupDev |
deprecated, use |
ylimFixed |
if TRUE, ylim of all histograms will be the same. Useful to visually assess the proportions of the individual samples. |
col |
colour(s) to be used to fill the bars. The default of
|
border |
the color(s) of the |
main |
the title(s) of the individual histograms. If a character vector is suplied, it will be used to define the title of individual histograms, recycled if necessary. |
xlab |
xlab(s) of the individual histograms. If a character vector is suplied, it will be used to define the title of individual histograms, recycled if necessary. |
callback |
|
debug |
if TRUE, debugs will be printed. If numeric of value greater than 1, verbose debugs will be produced. |
Tomas Sieger
# two aligned histograms with free 'ylim'
histv(seq(1,10), seq(1,20,.1))
# two aligned histograms with the same 'ylim' showing the relative
# proportions
histv(seq(1,10), seq(1,20,.1), ylimFixed=TRUE)
# 3 data arguments
set.seed(1)
n <- 1000
a <- rnorm(n)
b <- runif(n)
c <- rchisq(n,1)
histv(a, b, c, breaks = 100, main = c('N(0,1)', 'U(0,1)', 'Chisq(1)'),
col = c('gray','blue','red'))
# 1 single list argument holding 3 data vectors
histv(list(a, b, c), breaks = 100, main = c('N(0,1)', 'U(0,1)', 'Chisq(1)'),
col = c('gray','blue','red'))
# formula interface
histv(Sepal.Length~Species, iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.