check that concept names and ids match in a passed table
Source:R/omop_check_names.R
omop_check_names.Rd
check that concept names and ids match in a passed table
super short name func to check concept names
Usage
omop_check_names(
df,
id_col_name = "concept_id",
name_col_name = "concept_name"
)
ochecknames(df, id_col_name = "concept_id", name_col_name = "concept_name")
Examples
#example1 should pass, because names are joined from vocab
data.frame(concept_id=c(3571338L,4002075L)) |> omop_join_name() |> omop_check_names()
#> all 2 names and ids match
#> # A tibble: 0 × 4
#> # ℹ 4 variables: concept_id <int>, concept_name <chr>,
#> # concept_name_to_check <chr>, check <lgl>
#example2 with an incorrect name
tst <- data.frame(concept_id=c(4052465L,4052465L),
concept_name=c("test wrong name","Ex-pipe smoker")) |>
omop_check_names()
#> Warning: 1 names and ids don't match
#> 4052465Ex-pipe smokertest wrong nameFALSE