Description Usage Arguments Note Examples
View source: R/schemeGenerator.R
Generate a SetOfSchemes-class
object of speficified dimensions ( subjects, observations per t) for a given
set of time points which meets user specified constraints
1 2 3 4 | getSetOfSchemes(minNSubjects, maxNSubjects, minObsPerSubject,
maxObsPerSubject, timePoints, constraints = NULL,
maxRepetitionIndSchemes = 1, maxNumberOfSchemesBeforeChecks = 10^5,
returnNSchemesBeforeConstraints = FALSE)
|
minNSubjects |
numeric, the mimimum number of subjects per scheme |
maxNSubjects |
numeric, the maximum number of subjects per scheme |
minObsPerSubject |
numeric, the mimimum number of sampling occasions per subject |
maxObsPerSubject |
numeric, the maximum number of sampling occasions per subject |
timePoints |
numeric vector of time points larger then zero, at which subject can be sampled |
constraints |
data.frame specifying constraints the scheme should meet. with columns:
(a user can add constraint functions following
naming convention |
maxRepetitionIndSchemes |
the maximum number of times an individual subject scheme can be repeated, defaults to 1 |
maxNumberOfSchemesBeforeChecks |
the maximum number of schemes to consider before applying scheme constraints, to avoid to long processing and using up memory. defaults to 10^5 |
returnNSchemesBeforeConstraints |
if |
keep number of subjects , range of number of subjects and observations per subject and number of timep points restricted to avoid a large number of potential schemes slowing down computation and increasing memory usage
only schemes with minimal one observation per subject are contained even if not specified in constraints
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | timePoints <- c( 1.2 , 1.3 , 2, 5 )
constraints <- getConstraintsExample()
ex1 <- getSetOfSchemes( minNSubjects = 4 , maxNSubjects = 4 ,
minObsPerSubject = 3 , maxObsPerSubject = 3 , timePoints , constraints )
ex2 <- getSetOfSchemes( minNSubjects = 4 , maxNSubjects = 4 ,
minObsPerSubject = 3 , maxObsPerSubject = 3 , timePoints ,
constraints , maxRepetitionIndSchemes = 1 )
ex3 <- getSetOfSchemes( minNSubjects = 4 , maxNSubjects = 4 ,
minObsPerSubject = 2 , maxObsPerSubject = 3 , timePoints ,
constraints , maxRepetitionIndSchemes = 1 )
ex4 <- getSetOfSchemes( minNSubjects = 2 , maxNSubjects = 5 ,
minObsPerSubject = 2 , maxObsPerSubject = 3 , timePoints ,
constraints , maxRepetitionIndSchemes = 1 )
ex5 <- getSetOfSchemes( minNSubjects = 2 , maxNSubjects = 5 ,
minObsPerSubject = 2 , maxObsPerSubject = 3 , timePoints ,
maxRepetitionIndSchemes = 2 )
## Not run:
# this should trow an error (to many combinations required )
ex6 <- getSetOfSchemes( minNSubjects = 2 , maxNSubjects = 5 ,
minObsPerSubject = 2 , maxObsPerSubject = 3 , timePoints ,
maxRepetitionIndSchemes = 2 , maxNumberOfSchemesBeforeChecks = 1000 )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.