## count matrix
fl <- system.file(package="DirichletMultinomial", "extdata",
"Twins.csv")
count <- t(as.matrix(read.csv(fl, row.names=1)))
## phenotype
fl <- system.file(package="DirichletMultinomial", "extdata",
"TwinStudy.t")
pheno0 <- scan(fl)
lvls <- c("Lean", "Obese", "Overwt")
pheno <- factor(lvls[pheno0 + 1], levels=lvls)
names(pheno) <- rownames(count)
## subset
dim(count)
sum("Lean" == pheno)
dim(csubset("Lean", count, pheno))
dim(csubset("Lean", count, pheno, cidx=FALSE))
Run the code above in your browser using DataLab