R/rA.R

rA <-
function (r, scale = "nmi") 
{
  if(!(scale == "nmi" | scale == "km")) 
    stop("Unit square (nautical) miles or kilometers only")
  A <- sapply(r, function(x) geoarea(rPeri(x)))
  if(scale == "nmi") {
    A/1.852^2
  }
  else {
    A
  }
}

Try the geo package in your browser

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

geo documentation built on May 2, 2019, 5:22 p.m.