View source: R/f_assignmentType.R
| f.assignmentType | R Documentation |
Calculate type of assignment to intervention in a study
f.assignmentType(df = NULL)
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. |
data frame with columns '_id' and '.assignmentType', which is a factor with levels 'R' (randomised assignment) and 'NR' (all other types of assignment).
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.