cvSubsets {simulatorZ} | R Documentation |
To generate a list of subsets(indices of observations) from one set
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
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)