#' getSEFromBootStats
#'
#' @param l a list of vectors or matrices
#'
#' @return a dataframe containing the confidence intervals
#' @export
getSEFromBootStats <- function(l) {
l1 <- l[[1]]
if (class(l1) == "matrix" || class(l1) == "data.frame") {
ncols <- ncol(l1)
nrows <- nrow(l1)
map_dfr(1:ncols, function(i) {
vals <- map_dfc(.x = l, .f = function(mat) {mat[,i]})
SEs <- apply(vals, 1, sd) %>% tibble::enframe(name = NULL)
colnames(SEs) <- "SE"
SEs$row <- 1:nrows
SEs$col <- i
return(SEs)
})
} else if (class(l1) == "numeric" || class(l1) == "integer") {
vals <- map_dfc(.x = l, .f = identity)
SEs <- apply(vals, 1, sd) %>% tibble::enframe(name = NULL)
colnames(SEs) <- "SE"
SEs$index <- 1:length(l1)
return(SEs)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.