Skip to content
Prev 206618 / 398503 Next

using tabble

On Mon, 2010-01-18 at 17:17 +0800, Fan Dan wrote:
Hi!

If i understood your problem is easy create a fake data for example:

set.seed(123)
x<-rep(sample(1:7,5),3)
table(x)
x
3 4 5 6 7 
3 3 3 3 3

In this example the values "1" and "2" are missing

Solution change your variable to factor and determine your leveal
x.factor<-factor(x,levels=1:7)
table(x.factor)
x
1 2 3 4 5 6 7 
0 0 3 3 3 3 3