[R] Creating a frequency table for binomial varaible
arun4
arun.ganesh2012 at gmail.com
Wed Nov 21 14:19:42 CET 2012
Hello,
I have simulated 30 observations from a binomial(5,0.1) distribution.
Now I need to make frequency table( that means I need to tally how many 0's
, 1's 2's....... 5's)
I know that the simple R function table() will do this, but I am afraid
that some times I may get zero frequency for some particular values (for
example in the above there are 5-0's 10-1's , 14-2's, 10-3's , 11-4's but no
any 5's )
So I want to make by frequecy table ( as a date frame) as
value freq
0 5
1 10
2 14
3 10
4 11
5 0
How can I create such a table?
Forgive me if this is a very basic question. I am new to R.
Thank you very much.
--
View this message in context: http://r.789695.n4.nabble.com/Creating-a-frequency-table-for-binomial-varaible-tp4650286.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list