library(EDCimport)
library(dplyr)
= edc_example(N=200) %>%
db edc_unify_subjid() %>%
edc_clean_names()
db #> ── EDCimport database ──────────────────────────────────────────────────────────
load_database(db)
The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
You imported your database, but now you might want to visualize some part of it.
There are a lot of ways to do so, so EDCimport provides functions for a few concepts.
As in previous vignettes, we will be using edc_example()
, but in the real world you should use EDC reading functions. See vignette("reading")
to see how.
library(EDCimport)
library(dplyr)
= edc_example(N=200) %>%
db edc_unify_subjid() %>%
edc_clean_names()
db #> ── EDCimport database ──────────────────────────────────────────────────────────
load_database(db)
As the primary key is almost always SUBJID, {dplyr} joins can be simplified with default by
and suffix
arguments.
= enrol %>%
data_xx edc_left_join(data2) %>%
edc_right_join(data1) %>%
edc_full_join(ae)
dim(data_xx)
#> [1] 1240 23
names(data_xx) %>% stringr::str_subset("crfname") #suffixes are automated
#> [1] "crfname" "crfname_data2" "crfname_data1" "crfname_ae"
Using fct_yesno()
, you can harmonize “Yes/No” values into a vector with the “Yes” level first:
set.seed(42)
= tibble(a=c("Yes", "No"), b=c("Oui", "Non"), c=0:1, d=c(TRUE, FALSE))
x
x#> # A tibble: 2 × 4
#> a b c d
#> <chr> <chr> <int> <lgl>
#> 1 Yes Oui 0 TRUE
#> 2 No Non 1 FALSE
%>% dplyr::mutate_all(fct_yesno)
x #> # A tibble: 2 × 4
#> a b c d
#> <fct> <fct> <fct> <fct>
#> 1 Yes Yes No Yes
#> 2 No No Yes No
These three helpers don’t quite fit anywhere else, but they still deserve their moment!
save_session_info()
saves the output of session_info()
to a file.
edc_warn_extraction_date()
triggers a warning if the extraction date of your edc_database
is older than a specified threshold.
edc_inform_code()
outputs a message indicating the amount of code written for this analysis, assuming you have one file sourcing others.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.