Hello, I have indicators for the present of absent of a snps in columns and the categorey (case control column). I would like to extract ONLY the tables and the indices (SNPS) that give me 2 x 3 tables. Some gives 2x 2 tables when one of the allelle is missing. The data look like the matrix snpmat below: so the first snp should give me the following table: (aa=0, Aa=1 and AA=2)
aa Aa AA case 2 3 0 control 2 2 0 So I should not use this one or if I am using it, then I need to see 0 0 in to AA column which I don't see when I use the table command in R. snpmat category SNP1 SNP2 SNP3 .... SNPN case 1 0 2 1 case 0 1 1 2 case 1 2 2 0 control 0 1 0 1 control 1 2 1 2 control 0 0 0 0 case 1 0 2 2 case 0 1 2 1 control 1 0 0 1 -- Thanks, Jim. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.