Learn R Programming

ctrdata (version 1.4.1)

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 and outcome and its analysis by number of the measure which has "Hazard Ratio" in its name).

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 five columns: trial_id, main_id, sub_id, 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