R/hasenvelope.R

Defines functions envelope.hasenvelope print.hasenvelope hasenvelope

Documented in envelope.hasenvelope hasenvelope print.hasenvelope

#'
#'    hasenvelope.R
#'
#'    A simple class of objects which contain additional envelope data
#' 
#'    $Revision: 1.1 $ $Date: 2015/10/05 06:20:31 $

hasenvelope <- function(X, E=NULL) {
  if(inherits(E, "envelope")) {
    attr(X, "envelope") <- E
    class(X) <- c("hasenvelope", class(X))
  }
  return(X)
}

print.hasenvelope <- function(x, ...) {
  NextMethod("print")
  splat("[Object contains simulation envelope data]")
  return(invisible(NULL))
}

envelope.hasenvelope <- function(Y, ..., Yname=NULL) {
  if(is.null(Yname)) Yname <- short.deparse(substitute(Y))
  E <- attr(Y, "envelope")
  return(envelope(E, ..., Yname=Yname))
}
  

Try the spatstat.explore package in your browser

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

spatstat.explore documentation built on Oct. 23, 2023, 1:07 a.m.