R/calculate_area.R

# calculate_area.R
# calculate total area based on bounds
calculate_area <- function(bounds)
{
    dim <- length(bounds)/2
    area = 1
    for ( i in 1:dim){
        area = area * (bounds[2*i]-bounds[2*i-1])
    }
    if (area<0){
        stop("upper bound less than lower bound.")
    }
    return(area)
}
ddlee96/mcmi documentation built on May 15, 2019, 1:52 a.m.