R/addmark.ppp.R

Defines functions addmark.ppp

Documented in addmark.ppp

addmark.ppp <-
function(X,add.mark,add.name="storey"){
  stopifnot(spatstat::is.ppp(X))
  df.X<-as.data.frame(X)
  df.addX<-data.frame(cbind(df.X,add.mark))
  names(df.addX)<-c(names(df.X),add.name)
  newX<-spatstat::ppp(X$x,X$y,window=X$window,
     marks=df.addX[,-match(c("x","y"),colnames(df.addX))])
  return(newX)
}

Try the forestSAS package in your browser

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

forestSAS documentation built on May 1, 2019, 10:15 p.m.