Defines functions internal_to_ppp

Documented in internal_to_ppp

#' Data to spatstat format
#' @param x Pattern in internal format
#' @export
internal_to_ppp <-function(x) {
  x <- internalise_pp(x) # just to be sure
  win <- if(!is.null(x$owin)) x$owin else as.owin(c(x$bbox))
  coords <- x$coord
    ppp(coords[,1], coords[,2], window=win, mark=cbind(mass=x$mass, type=x$type))
    pp3(coords[,1], coords[,2], coords[,3], c(x$bbox))

Try the SGCS package in your browser

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

SGCS documentation built on May 1, 2019, 8:20 p.m.