# Generated by fusen: do not edit by hand
#' Get Weights
#'
#' Description
#'
#' @param .tab
#' A dataframe (either the source or target dataframe)
#' @param .cols_match
#' A character vector of columns to perform fuzzy matching.
#'
#' @return A numeric vector
#'
#' @export
#' @examples
#' get_weights(table_source, c("name", "city", "address"))
get_weights <- function(.tab, .cols_match) {
. <- NULL
purrr::map_dbl(
.x = stats::setNames(.cols_match, .cols_match),
.f = ~ mean(uniqueness_vec(.tab[[.x]]), na.rm = TRUE)
) %>% `/`(sum(., na.rm = TRUE))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.