This is my first question, and I'm pretty new to R , and I could not find how to do this.
So, I get some numbers that I want to put in the frequency table.
12 0 12 2 1 14 1 1 0 3 1 2 8 0 1 3 11 1 1 8 8 8 0 4 4 2 6 1 1 4 1 1 7 0 6 4 6 1 1 1 1 2 4 2 3 7 3 1 1 7 0 0 11 8 1 5 0 5 6 0 0 0 13 1 1 5 2 7 2 1 7 3 4 4 2 4 0 4 4 0 4 0 2 1 1 1 0 5 6 1 4 1 5 3 3 4 0 3 1 0
When I use the table(X) function, I get something similar to
X 0 1 2 3 4 5 6 7 8 11 12 13 14 17 27 9 8 13 5 5 5 5 2 2 1 1
Which leaves values โโof 9 and 10! I am trying to make values โโ9, 10 with a zero number.
I tried using xtabs and tapply , but I'm just not sure how to do this.
source share