R/list_to_matrix.R

Defines functions list_to_matrix

Documented in list_to_matrix

list_to_matrix<-function(x,item=NA){
  maxlength<-max(sapply(x,length))
  return(t(sapply(x,function(row,maxlength) c(row,rep(item,maxlength-length(row))),maxlength)))
}
Zongzheng/forestSAS documentation built on July 13, 2024, 8:12 p.m.