s-news
[Top] [All Lists]

[S] summary creating factor

To: splus mailinglist <s-news@wubios.wustl.edu>
Subject: [S] summary creating factor
From: Hannoever <hann@Psyres-Stuttgart.DE>
Date: Thu, 18 Feb 1999 10:59:29 +0100 (MET)
Sender: owner-s-news@wubios.wustl.edu
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

<Prev in Thread] Current Thread [Next in Thread>
  • [S] summary creating factor, Hannoever <=