# Generated by fusen: do not edit by hand
#' Check Weights
#'
#' @param .weights weights
#' @param .cols columns
#'
#' @return Error
#' @noRd
#' @examples
#' # help_check_weights()
help_check_weights <- function(.weights = NULL, .cols = NULL) {
if (!is.null(.weights)) {
nw_ <- sort(names(.weights))
nc_ <- sort(.cols)
lw_ <- length(nw_)
lc_ <- length(nc_)
if (lw_ == 0) stop(".weights must be a named vector", call. = FALSE)
if (!lw_ == lc_) stop(".weights and .cols must have the same length", call. = FALSE)
if (!all(nw_ == nc_)) stop(".weights and .cols must have the same names", call. = FALSE)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.