How do I create a second dataframe that shows unique column values from first
dataframe and the number count of rows in first dataframe where column value
appears?
For example, first dataframe is this:
> x <- matrix(c(101:104,101:104,105:106,1:10), nrow=10, ncol=2)
> x
[,1] [,2]
[1,] 101 1
[2,] 102 2
[3,] 103 3
[4,] 104 4
[5,] 101 5
[6,] 102 6
[7,] 103 7
[8,] 104 8
[9,] 105 9
[10,] 106 10
>
>From above dataframe I would like to generate count summary dataframe:
id count
[1,] 101 2
[2,] 102 2
[3,] 103 2
[4,] 104 2
[5,] 105 1
[6,] 106 1
Thanks for the help, Ted
______________________________________________
[email protected] 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.