[S] Relabeling of factors

Ori Davidov (ori@fhcrc.org)
Tue, 6 Oct 1998 10:36:51 -0700 (PDT)


There must be a elegant way of relabeling the levels of a factor. I want
to change the levels of the factor

> time[1:15]
[1] 0:pre 1:1.5H 2:4H 3:8H 4:24H 0:pre 1:1.5H 2:4H
[9] 3:8H 4:24H 0:pre 1:1.5H 2:4H 3:8H 4:24H
Levels (first 5 out of 6):
[1] "" "0:pre" "1:1.5H" "2:4H" "3:8H"
>

to 0,1.5,4,8,24.

I have been using

time[time=="0:pre"] <- "0" ect

is there a better way?

Thanks, Ori.

-----------------------------------------------------------------------
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