#' Title
#'
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
bind_bootstrap_score <- function(...) {
check_class <- function(x) {
inherits(x, "harp_bootstrap")
}
dots <- list(...)
if (length(dots) == 1) dots <- dots[[1]]
dots <- dots[sapply(dots, function(x) !is.null(x))]
if (!all(sapply(dots, check_class))) {
bad_classes <- which(!sapply(dots, check_class))
bad_classes <- paste0("..", paste(bad_classes, sep = ", .."))
stop(
bad_classes, " are not 'harp_bootstrap' objects.\n",
"Only outputs of 'bootstrap_score()' and 'pooled_bootstrap_score()' can be used."
)
}
if (length(dots) == 1) return(dots[[1]])
list_names <- unique(unlist(lapply(dots, names)))
res <- lapply(
list_names,
function(x) Reduce(rbind, lapply(dots, function(y) y[[x]]))
)
names(res) <- list_names
new_harp_bootstrap(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.