R/density.combinedGradientForest.r

Defines functions `density.combinedGradientForest`

`density.combinedGradientForest` <-
function(x,predictor,gridded=F,gf.name,...)
{
  if (!inherits(x,"combinedGradientForest"))
    stop(paste("'x' must be a combinedGradientForest object"))
  if(!gridded) {
    if(missing(gf.name))
      x$dens$Combined[[predictor]]
    else x$dens[[gf.name]][[predictor]]
  } else {
    if(missing(gf.name))
      with(x$CU[[predictor]]$density, list(x=x, y=y[,"Combined"]))
    else with(x$CU[[predictor]]$density, list(x=x, y=y[,gf.name]))
  }  
}

Try the gradientForest package in your browser

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

gradientForest documentation built on Aug. 24, 2023, 3:03 p.m.