Learn R Programming

ctrdata (version 1.5.2)

dfTrials2Long: Extract trial information into long format

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

dfTrials2Long(df)

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

Run this code
# NOT RUN {
db <- nodbi::src_sqlite(
  collection = "my_collection"
)
df <- dbGetFieldsIntoDf(
  fields = c(
    "clinical_results.outcome_list.outcome"),
  con = db
)
dfTrials2Long(
  df = df
)
# }

Run the code above in your browser using DataLab