View source: R/find_synonyms.R
find_synonyms | R Documentation |
Look up the root item that corresponds to each item's synonym
find_synonyms(.x, key_col = "PrimaryKey", syn_col = "Synonym")
.x |
a data frame with primary keys and self-referential synonyms |
key_col |
the column that contains the primary keys |
syn_col |
the column that contains self-referential keys |
a vector of primary keys
discrete_example <- tibble::tribble(
~ PrimaryKey, ~ Dimension, ~ Order, ~ Label, ~ Synonym,
1L, 1L, 1L, "A", NA,
2L, 1L, 2L, "B", NA,
3L, 1L, 3L, "C", NA,
4L, 1L, NA, "Alpha", 1L,
5L, 1L, NA, "Beta", 2L,
6L, 1L, NA, "Gamma", 3L,
7L, 1L, NA, "\u03B1", 4L
)
synonyms <- find_synonyms(discrete_example)
dplyr::slice(discrete_example, synonyms)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.