3
For the following case the x count using the function table will return the frequency of the existing values. I would like to know how to return the count to the discrete interval from 1 to 12, including the values whose frequency is zero.
set.seed(2)
x <- sample.int(12, 50, replace = TRUE)
table(x)
This solution meets the problem. Thank you very much.
– Caluan