R/addmark.ppp.R

addmark.ppp <-
function(X,add.mark,add.name="storey"){
  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)
}
Zongzheng/forestSAS documentation built on May 10, 2019, 1:59 a.m.