Hist {biology} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
Hist(x, scale = c("frequency", "percent", "density"), ...)
x |
~~Describe x here~~ |
scale |
~~Describe scale here~~ |
... |
~~Describe ... here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
~~further notes~~
~Make other sections like Warning with Warning .... ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- 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, scale = c("frequency", "percent", "density"), ...) { xlab <- deparse(substitute(x)) xlab <- (strsplit(xlab, "\$")[[1]][2]) x <- na.omit(x) scale <- match.arg(scale) if (scale == "frequency") hist(x, xlab = xlab, main = "", ...) else if (scale == "density") hist(x, freq = FALSE, xlab = xlab, main = "", ...) else { n <- length(x) hist(x, axes = FALSE, xlab = xlab, ylab = "Percent", main = "", ...) axis(1) max <- ceiling(10 * par("usr")[4]/n) at <- if (max <= 3) (0:(2 * max))/20 else (0:max)/10 axis(2, at = at * n, labels = at * 100) } box() abline(h = 0, col = "gray") invisible(NULL) }