R/accumplot.R

Defines functions `accumplot`

`accumplot` <-
function(xr, addit=F, labels="", col=1, ci=2, pch=1, type="p", cex=1,
    xlim=c(1,xmax), ylim=c(1,rich), xlab="sites", ylab="species richness",
    cex.lab=1, cex.axis=1, ...) 
{
    x <- xr
    xmax <- max(x$sites)
    rich <- max(x$richness)    
    if(addit==F) {graphics::plot(x$sites, x$richness, xlab=xlab, ylab=ylab, bty="l",
        type=type, col=col, pch=pch, cex=cex, xlim=xlim, ylim=ylim, cex.lab=cex.lab, cex.axis=cex.axis)} 
    if(addit==T) {graphics::points(x$sites, x$richness, type=type, col=col, pch=pch, cex=cex)}
    graphics::plot(x, add=T, ci=ci, col=col, ...)
    if(labels!="") {
        l <- length(x$sites)
        graphics::text(x$sites[1], x$richness[1], labels=labels, col=col, pos=2, cex=cex)
        graphics::text(x$sites[l], x$richness[l], labels=labels, col=col, pos=4, cex=cex)
    }
}

Try the BiodiversityR package in your browser

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

BiodiversityR documentation built on Oct. 22, 2023, 5:06 p.m.