Description Usage Arguments Value See Also Examples
This function filters a column that contains Concept Strips using Concept Table parameters. The target column may contain 1 or more merged concept strip, and the multiple strips must be separated by a new line \"\n\" for the filter to operate correctly. It is important to note that the the filter is applied to the entire Concept Strip cell and will not alter the data content within the cell otherwise. For example, if the filter ‘vocabulary_id == ’RxNorm'' is used for 'ColumnA', a 'ColumnA' cell that contains at least 1 RxNorm concept will be filtered for though there are other non-RxNorm concepts in that same cell.
1 | filter_strip(data, strip_col, ...)
|
data |
dataframe with the merged concept column |
... |
arguments that will be passed to the dplyr filter function using the base Concept Table field names |
merge_col |
column of merged concepts |
A tibble with the same number of columns as the input with the number of rows equal or less than that of the input.
tidyeval-compat
,mutate
,filter_all
,filter
,select
,distinct
as_name
separate_rows
normalize_all_to_na
Other concept format functions:
filter_at_all_strip()
,
filter_at_any_strip()
,
get_strip()
,
label_to_strip()
,
merge_label()
,
merge_strip()
,
unbox_label()
,
unbox_strip()
,
unmerge_label()
,
unmerge_strip()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | library(tidyverse)
library(chariot)
conn <- connectAthena()
test_data <-
queryAthena("SELECT * FROM omop_vocabulary.concept ORDER BY RANDOM() LIMIT 20;",
conn = conn)
# Merge
merge_strip(data = test_data,
into = "concept")
# Merge while sparing some original columns such as vocabulary_id and
# concept_class_id
merge_strip(data = test_data,
into = "concept",
vocabulary_id,
concept_class_id)
# Test filtering of strip columns
test_output <- merge_strip(data = test_data,
into = "concept") %>%
dplyr::select(-concept_id)
# Filter at a Strip Column
filter_strip(test_output,
strip_col = concept,
vocabulary_id %in% c("SNOMED"))
# Filter at more than 1 Strip Column
test_data <-
dplyr::bind_cols(test_output %>%
rubix::randomize() %>%
dplyr::select(concept_a = concept),
test_output %>%
rubix::randomize() %>%
dplyr::select(concept_b = concept))
filter_at_all_strip(data = test_data,
strip_cols = c("concept_a",
"concept_b"),
vocabulary_id %in% c("RxNorm"))
filter_at_any_strip(data = test_data,
strip_cols = c("concept_a",
"concept_b"),
vocabulary_id %in% c("RxNorm"))
dcAthena(conn = conn)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.