Description Usage Arguments Value Author(s) Examples
To generate a list of subsets(indices of observations) from one set
1 | cvSubsets(obj, fold)
|
obj |
a ExpressionSet, matrix or RangedSummarizedExperiment object. If it is a matrix,columns represent samples |
fold |
the number of folds in cross validation. Number of observations in the set does not need to be a multiple of fold |
returns the list of indices of subsets
Yuqing Zhang, Christoph Bernau, Levi Waldron
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | library(curatedOvarianData)
data(E.MTAB.386_eset)
id <- cvSubsets(E.MTAB.386_eset, 3)
subsets <- lapply(1:3, function(i){E.MTAB.386_eset[1:10, id[[i]]]})
sapply(subsets, dim)
rm(subsets)
## Number of observations in the set does not need to be a multiple of
## the fold parameter
id2 <- cvSubsets(E.MTAB.386_eset, 5)
subsets <- lapply(1:5, function(j){E.MTAB.386_eset[1:10, id2[[j]]]})
sapply(subsets, dim)
rm(subsets)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.