utils::globalVariables(c("key", "stat", ".", "name"))
#' @title Make table of regression statistics
#'
#' @name reginfotable
#' @param reginfo list of regression statistics extracted by .reginfo function
#'
#' @return data.frame of regression statistics
#' @export
reginfotable <- function(reginfo) {
stats.list <- data.frame(
key = c("rsq", "adj.rsq", "f", "n"),
name = c("R2", "Adjusted R2", "F-stat", "N"),
stringsAsFactors = FALSE
)
keep <- reginfo %>%
list.map(as.matrix(.[["list"]])) %>% list.cases()
var_name <- stats.list %>% filter(key %in% keep)
res <- suppressWarnings(
reginfo %>%
list.map(
.[["value"]] %>%
right_join(var_name, by = "key") %>%
select(stat)
) %>%
list.cbind()
)
tab <- var_name %>% select(name) %>% cbind(., res)
rownames(tab) <- NULL
return(tab)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.