dfName2Value: Extract information of interest (e.g., endpoint) from long...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Extract information of interest (e.g., endpoint) from long data frame of protocol- or result-related trial information as returned by dfTrials2Long

Usage

1
dfName2Value(df, valuename = "", wherename = "", wherevalue = "")

Arguments

df

A data frame with four columns (_id, identifier, name, value) as returned by dfTrials2Long

valuename

A character string for the name of the variable from which to extract information for the variable of interest

wherename

A character string to identify the variable of interest

wherevalue

A character string with the value of interest for the variable of interest

Value

A data frame with columns _id, identifier, name, value that only includes the values of interest, where value are strings unless all value elements are numbers.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## Not run: 
db <- nodbi::src_sqlite(
  collection = "my_collection"
)
df <- ctrdata::dbGetFieldsIntoDf(
fields = c(
  # ctgov - typical results fields
  "clinical_results.baseline.analyzed_list.analyzed.count_list.count",
  "clinical_results.baseline.group_list.group",
  "clinical_results.baseline.analyzed_list.analyzed.units",
  "clinical_results.outcome_list.outcome",
  "study_design_info.allocation",
  # euctr - typical results fields
  "trialInformation.fullTitle",
  "subjectDisposition.recruitmentDetails",
  "baselineCharacteristics.baselineReportingGroups.baselineReportingGroup",
  "endPoints.endPoint",
  "trialChanges.hasGlobalInterruptions",
  "subjectAnalysisSets",
  "adverseEvents.seriousAdverseEvents.seriousAdverseEvent"
  ), con = dbc
)
# convert to long
reslong <- ctrdata::dfTrials2Long(
  df = df
)
# get values for endpoint of interest, duration of response
ctrdata::dfValue2Name(
  df = df,
  valuename = paste0(
    "endPoints.endPoint.*armReportingGroup.tendencyValues.tendencyValue.value|",
    "clinical_results.*category.measurement_list.measurement.value|",
    "clinical_results.*outcome.measure.units|endPoints.endPoint.unit"
  ),
  wherename = "clinical_results.*outcome.measure.title|endPoints.endPoint.title",
  wherevalue = "duration of response"
)

## End(Not run)

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