select_distinct {EDCimport} | R Documentation |
Select only distinct columns
Description
Select all columns that has only one level for a given grouping scope. Useful when dealing with mixed datasets containing both long data and repeated short data.
Usage
select_distinct(df, .by)
Arguments
df |
a dataframe |
.by |
optional grouping columns |
Value
df
with less columns
Examples
db = edc_example()
db$ae %>% colnames()
#`crfname` has one level for the whole dataset
db$ae %>% select_distinct() %>% colnames()
#`n_ae` has one level per patient
db$ae %>% select_distinct(.by=subjid) %>% colnames()
[Package EDCimport version 0.6.0 Index]