Dear S+ users,
obviously this was a simple question. Thanks to all who replied.
The simplest solution is to use the levels subcommand for the factor
function, instead of using the cut function.
my.factor <- factor(my.continous, levels=1:max(my.continous))
The same works with the ordered function.
Also the cut2 function from the hmisc library can do the trick.
Finally, using tabulate instead of table adds the first level
automatically.
Again, many thanks to all who helped.
wolfgang
*********************************************
Wolfgang Hannoever
Forschungsstelle fuer Psychotherapie
Christian-Belser-Str. 79a
70597 Stuttgart
Tel.: 0711 / 6781-407 Fax:0711 / 6876902
e-mail:hann@psyres-stuttgart.de
*********************************************
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|