R/as.Dtable.data.frame.R

Defines functions as.Dtable.data.frame

Documented in as.Dtable.data.frame

as.Dtable.data.frame <- function(X, ...) {
  # Convert X to a wmppp
  X <- as.wmppp.data.frame(X, ...)

  # Get the distance matrix
  Dmatrix <- spatstat.geom::pairdist(X)

  # Convert
  return(
    Dtable(
      Dmatrix,
      PointType = marks(X)$PointType,
      PointWeight = marks(X)$PointWeight
    )
  )
}

Try the dbmss package in your browser

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

dbmss documentation built on June 8, 2025, 1:59 p.m.