R/utils.R

#' @importFrom stringdist stringdist
#' @importFrom rlang quo_name enquo enquos
#' @importFrom tibble tibble
#'
tibble_dist <- function(df, v1, v2, method, ...){
  str_dist <- stringdist(a=df[[quo_name(enquo(v1))]],
                         b=df[[quo_name(enquo(v2))]],
                         method=method,
                         ...)

  tibble(!! method := str_dist)
}

Try the tidystringdist package in your browser

Any scripts or data that you put into this service are public.

tidystringdist documentation built on May 2, 2019, 3:23 p.m.