Function that tries to detect spelling mistakes in a given activity log column

detect_similar_labels(
  activitylog,
  column_labels,
  max_edit_distance = 3,
  show_NA = FALSE,
  ignore_capitals = FALSE,
  filter_condition = NULL
)

Arguments

activitylog

The activity log

column_labels

The name of the column(s) in which to search for spelling mistakes

max_edit_distance

The maximum number of insertions, deletions and substitutions that are allowed to be executed in order for two strings to be considered similar.

show_NA

A boolean indicating if labels that do not show similarities with others should be shown in the output

ignore_capitals

A boolean indicating if capitalization should be included or excluded when calculating the edit distance between two strings

filter_condition

Condition that is used to extract a subset of the activity log prior to the application of the function

Value

tbl_df providing an overview of similar labels for the indicated column

Examples

# \donttest{ data("hospital_actlog") detect_similar_labels(activitylog = hospital_actlog, column_labels = "activity", max_edit_distance = 3)
#> # A tibble: 5 x 3 #> column_labels labels similar_to #> <chr> <chr> <chr> #> 1 activity registration Registration #> 2 activity Registration registration #> 3 activity Triage Trage - Triaga #> 4 activity Trage Triage - Triaga #> 5 activity Triaga Triage - Trage
# }