R/compute_mean_leaves.R

Defines functions compute_mean_leaves

compute_mean_leaves <- function(forest){

 if(is.null(forest$leaf_summary)){
  return(0)
 }

 collapse::fmean(
  vapply(forest$leaf_summary,
         function(leaf_smry) sum(leaf_smry != 0),
         FUN.VALUE = integer(1))
 )

}

Try the aorsf package in your browser

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

aorsf documentation built on Oct. 26, 2023, 5:08 p.m.