R/transectHolder.R

Defines functions transectHolder

Documented in transectHolder

transectHolder <- function(..., family="exponential") {
  transectHolder <- list()
  transectHolder$transects <- list(...)
  distname <- tolower(family)
  transectHolder$family <- family
  transectHolder$parameters <-  fitDistances(transectHolder, distname)
  transectHolder$rng <- switch(distname,
                               "beta" = "rbeta",
                               "chi-squared" = "rchisq",
                               "exponential" = "rexp",
                               "f" = "rf",
                               "gamma" = "rgamma",
                               "log-normal" = "rlnorm",
                               "lognormal" = "rlnorm",
                               "negative binomial" = "rnbinom",
                               "poisson" = "rpois",
                               "weibull" = "rweibull",
                               NULL)
  if (is.null(transectHolder$rng))
    stop("Unsupported distribution")
  class(transectHolder) <- "transectHolder"
  return(transectHolder)
}

Try the spuRs package in your browser

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

spuRs documentation built on May 2, 2019, 12:44 p.m.