Dear Tian,
You could simply try that: table(a[,1], a[,2], a[,3])
Regards,
Sandrine Lunven
-Message d'origine-
De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De
la part de Tian Shen
Envoyé : jeudi 9 avril 2009 09:06
À : r-help@r-project.org
Objet : [R] Creat
Dear all,
I have a matrix as follows:
a=matrix(c(1,2,3,1,2,3,1,2,3,6,5,7,7,5,7,5,6,5,"Y", "N","Y","Y","N","Y",
"N","Y","Y"),ncol=3)
> a
[,1] [,2] [,3]
[1,] "1" "6" "Y"
[2,] "2" "5" "N"
[3,] "3" "7" "Y"
[4,] "1" "7" "Y"
[5,] "2" "5" "N"
[6,] "3" "7" "Y"
[7,] "1" "5" "N"
2 matches
Mail list logo