createTrial: A function to create instances of the ClinicalTrial class.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/classes.R

Description

This function should be used in preference to calls to new to create instances of the ClinicalTrials class.

Usage

1
createTrial(CExp, seed)

Arguments

CExp

An instance of the ClinicalExperiment class.

seed

A seed for the random number generator.

Details

To ensure proper initialization of the different components this function should be called when creating new instances of the ClinicalTrial class.

Value

An instance of the ClinicalTrial class.

Author(s)

R. Gentleman

See Also

ClinicalExperiment-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 #define the available treatments and their relative allocations
 trts = c( A = 3L, B = 4L, C = 1L)
 #describe the permuted block design
 pbdesc = new("PermutedBlockDesc", treatments = trts, type="PermutedBlock",
     numBlocks=4L)

 pIDs = new("PatientID", strata="Test", start=100L, stop=200L)

 #define the ClinicalExperiment
 CE1 = new("ClinicalExperiment",
    name="My first experiment",
    treatments = trts,
    factors = list( F1 = c("A", "B", "C"), F2 = c("t1", "t2")),
    randomization = list(pbdesc),
    patientIDs = pIDs
 )


 #now create the instance of the trial
 CT1 = createTrial(CE1, seed=301)

randPack documentation built on Nov. 8, 2020, 5:32 p.m.