#' Extract explained deviance from BRT
#'
#' function to extract explained deviance from BRT
#'
#' @param x A fitted BRT model object, e.g. as returned from \code{\link{brt_sdm}}
#'
#' @return The deviance
#'
#' @examples
#' # use defaults
#' sim1 <- SimulateWorld(start.year=2015, n.year=20)
#' fit <- brt_sdm(sim, "temp")
#' dev_eval(fit)
#'
#' @export
dev_eval <- function(x){
null <- x$self.statistics$mean.null
res <- x$self.statistics$mean.resid
dev <- ((null - res)/null)*100
return(dev)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.