R/plot.hrsize.r

Defines functions plot.hrsize

Documented in plot.hrsize

plot.hrsize <- function (x, ...)
{
    ## Verifications
    if (!inherits(x, "hrsize"))
        stop("should be of class hrsize")

    ## Graphical settings
    opar <- par(mfrow = n2mfrow(ncol(x)))
    on.exit(par(opar))

    ## The labels
    if (!is.null(attr(x, "xlabel"))) {
       xlabel <- attr(x, "xlabel")
    } else {
       xlabel <- "Home-range level"
    }
    if (!is.null(attr(x, "ylabel"))) {
       ylabel <- attr(x, "ylabel")
    } else {
       ylabel <- paste("Home-range size (", attr(x, "units"), ")", sep = "")
    }

    ## The plot
    for (i in 1:ncol(x)) {
        plot(as.numeric(row.names(x)), x[, i], main = names(x)[i],
            pch = 16, cex = 0.5, xlab = xlabel, ylab = ylabel)
        lines(as.numeric(row.names(x)), x[, i])
    }
}

Try the adehabitat package in your browser

Any scripts or data that you put into this service are public.

adehabitat documentation built on Jan. 28, 2018, 5:02 p.m.