Learn R Programming

ctrdata (version 1.22.0)

f.sampleSize: Calculate sample size of a study

Description

Trial concept calculated: sample size of the trial, preferring results-related over protocol-related information.

Usage

f.sampleSize(df = NULL)

Value

data frame with columns `_id` and `.sampleSize`, an integer.

Arguments

df

data frame such as from dbGetFieldsIntoDf. If `NULL`, prints fields needed in `df` for calculating this trial concept, which can be used with dbGetFieldsIntoDf.

Examples

Run this code
# fields needed
f.sampleSize()

# apply trial concept when creating data frame
dbc <- nodbi::src_sqlite(
  dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
  collection = "my_trials", flags = RSQLite::SQLITE_RO)
trialsDf <- dbGetFieldsIntoDf(
  calculate = "f.sampleSize",
  con = dbc)
trialsDf

Run the code above in your browser using DataLab