Hist {biology}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

Hist(x, scale = c("frequency", "percent", "density"), ...)

Arguments

x ~~Describe x here~~
scale ~~Describe scale here~~
... ~~Describe ... here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use
comp1 Description of 'comp1'
comp2 Description of 'comp2'
...

Note

~~further notes~~

~Make other sections like Warning with Warning .... ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- 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)
  }

[Package biology version 1.0 Index]