R/print.HOF.list.r

#' @export
"print.HOF.list" <-  function (
		x,
		test = 'AICc',
		selectMethod = 'bootselect',
		...) {
	if(selectMethod == 'bootselect' & is.null(x[[1]]$bootstrapmodels)) {
		message('Bootstrap results missing. Using selectMethod "pick.model" instead.\n')
		selectMethod <- 'pick.model'
	}
    cat("Deviances:\n")
    sapply(sapply(x, function(m) m$models), '[[', 'deviance')
    printCoefmat(sapply(x, function(x) deviance(x)), na.print="", has.Pvalue=FALSE, ...)
    cat(paste("\nSuggested best models (",test, ", ", selectMethod, "):", sep=''))
    tmp <- sapply(x, pick.model, test=test, selectMethod = selectMethod, silent = TRUE, ...)
    names(tmp) <- names(x)
    cat('\n')
    print(noquote(tmp))
#    if(!is.null(x[[1]]$bootstrapmodels)) {
#      bootpick <- sapply(x, function(x) x$bootstrapmodels)
#      cat('\nPercentage of equal model types during bootstrapping\n')
#      perc <- vector('integer', length=ncol(bootpick))
#      names(perc) <- names(x)
#      for(i in 1:ncol(bootpick)) perc[i] <- round(sum(bootpick[,i]==tmp[i])/nrow(bootpick)*100,0)
#      print(perc)
#      }
    invisible(x)
}

Try the eHOF package in your browser

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

eHOF documentation built on May 29, 2024, 5:59 a.m.