dfTrials2Long: Extract trial information into long format

Description Usage Arguments Value Examples

View source: R/utils.R

Description

The function works with procotol- and results- related information. It converts lists and other values into individual rows of a long data frame. From the resulting data frame, values of interest can then be selected (e.g. select an outcome and its analysis by the identifier of the measure which has "Hazard Ratio" in its name, see dfName2Value).

Usage

1

Arguments

df

Data frame with columns including the trial identifier (_id) and one or more variables as obtained from dbGetFieldsIntoDf

Value

A data frame with the four columns: _id, identifier, name, value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
db <- nodbi::src_sqlite(
  collection = "my_collection"
)
df <- dbGetFieldsIntoDf(
  fields = c(
    "clinical_results.outcome_list.outcome"),
  con = db
)
dfTrials2Long(
  df = df
)

## End(Not run)

ctrdata documentation built on Nov. 22, 2021, 1:06 a.m.