View source: R/dfTrials2Long.R
dfTrials2Long | R Documentation |
The function works with procotol- and results- related information.
It converts lists and other values that are in a data frame returned
by dbGetFieldsIntoDf into individual rows of a long data frame.
From the resulting long data frame, values of interest can be selected
using dfName2Value.
The function is particularly useful for fields with complex content,
such as node field "clinical_results
" from EUCTR, for which
dbGetFieldsIntoDf returns as a multiply nested list and for
which this function then converts every observation of every (leaf)
field into a row of its own.
dfTrials2Long(df)
df |
Data frame (or tibble) with columns including
the trial identifier ( |
A data frame (or tibble, if tibble
is loaded)
with the four columns: '_id', 'identifier', 'name', 'value'
dbc <- nodbi::src_sqlite(
dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
collection = "my_trials")
dfwide <- dbGetFieldsIntoDf(
fields = "clinical_results.participant_flow",
con = dbc)
dfTrials2Long(df = dfwide)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.