R/NS.spattemp.R

Defines functions NS.spattemp

Documented in NS.spattemp

#' @rdname NS
#' @export
NS.spattemp <- function(pp, tt = NULL, nstar = "npoints", scaler = c("silverman", "IQR", "sd", "var")){
  if(!inherits(pp,"ppp")) stop("data argument 'pp' must be of spatstat class \"ppp\"; see ?ppp")
  
  if(is.null(tt)) tt <- marks(pp)
  tt <- checktt(tt)
  if(length(tt)!=npoints(pp)) stop(paste("Length of temporal vector does not match number of spatial observations\n   npoints(pp) = ",npoints(pp),"; length(tt) = ",length(tt),sep=""))
  
  scaler <- processscaler.st(scaler,pp,tt)
  nstar <- processnstar.st(nstar,pp)
  
  result <- scaler*c(nstar^(-1/6),0.9*nstar^(-1/5))
  
  names(result) <- c("h","lambda")
  return(result)
}

Try the sparr package in your browser

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

sparr documentation built on March 31, 2023, 8:40 p.m.