Skip to content

Which variable exist after random

2 messages · TEMPL Matthias, Sofyan Iyan

#
Or is this what you want?

Tab <- table(sample(testx, replace=TRUE))
Tab[ Tab > 0 ]
#
Thanks for your help.
How about if I count all. This below I have fixed my code which used
table. I need the result:

    Game Internet    Money    Paper     Time 
       4        1              1            4        0 

Regards, Sofyan
+         x <- sample(testx,replace=TRUE)
+         print(x)
+         print(table(x))
+     }
[1] Game  Paper Game  Paper Paper
Levels: Game Internet Money Paper Time
x
    Game Internet    Money    Paper     Time 
       2        0        0        3        0 
[1] Game     Game     Internet Paper    Money   
Levels: Game Internet Money Paper Time
x
    Game Internet    Money    Paper     Time 
       2        1        1        1        0

        
On 6/1/05, TEMPL Matthias <Matthias.Templ at statistik.gv.at> wrote: