contrastSampleIndices | R Documentation |
Return indices of samples involved in the given contrast of two or more coefficients
contrastSampleIndices(object, contrast)
## S4 method for signature 'DesignContrast,character'
contrastSampleIndices(object, contrast)
## S4 method for signature 'DesignContrast,numeric'
contrastSampleIndices(object, contrast)
object |
A |
contrast |
Either a contrast name or a integer indicating the index of the contrast |
An integer vector, indices of samples that are involved, sorted by the ascending order of the coefficients of the contrast
contrastSampleIndices(object = DesignContrast, contrast = character)
: Use character string to specify the contrast
contrastSampleIndices(object = DesignContrast, contrast = numeric)
: Use integer indices to specify the contrast
## one-way ANOVA
myDesCon <- parseDesignContrast(sampleGroups="As,Be,As,Be,As,Be",
groupLevels="Be,As", dispLevels="Beryllium,Arsenic", contrasts="As-Be")
contrastSampleIndices(myDesCon, 1L)
myInterDesCon <- DesignContrast(
designMatrix=matrix(c(rep(1,6), rep(0,2), rep(1,2), rep(0,2),
rep(0,4), rep(1,2)), nrow=6, byrow=FALSE),
contrastMatrix=matrix(c(0,1,0, 0,0,1, 0,-1,1), byrow=FALSE, nrow=3),
groups=factor(rep(c("As", "Be", "Cd"), each=2)),
dispLevels=c("Arsenic", "Beryllium", "Cadmium"))
cont1Ind <- contrastSampleIndices(myInterDesCon, 1L)
cont2Ind <- contrastSampleIndices(myInterDesCon, 2L)
cont3Ind <- contrastSampleIndices(myInterDesCon, 3L)
stopifnot(identical(cont1Ind, 1:4))
stopifnot(identical(cont2Ind, c(1:2, 5:6)))
stopifnot(identical(cont3Ind, c(3:6)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.