f.assignmentType {ctrdata} | R Documentation |
Calculate type of assignment to intervention in a study
Description
Calculate type of assignment to intervention in a study
Usage
f.assignmentType(df = NULL)
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. |
Value
data frame with columns '_id' and '.assignmentType', which is a factor with levels 'R' (randomised assignment) and 'NR' (all other types of assignment).
Examples
# fields needed
f.assignmentType()
# 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(
field = "ctrname",
calculate = "f.assignmentType",
con = dbc)
trialsDf
[Package ctrdata version 1.24.0 Index]