Betr.: [R] Levels number of a factor object

tobias.verbeke@bivv.be tobias.verbeke at bivv.be
Fri Jan 23 15:42:43 CET 2004





r-help-bounces at stat.math.ethz.ch wrote on 23/01/2004 15:24:21:

>
> Hi all!
>
>     How to retrieve the levels number of a factor object?
>     See this code:
>     groups<-gl(4,10)
>     I want to retrieve the number of levels (4) of my object "groups"
>     I tried groups.levels but this don't work

Is

length(levels(groups))


what you were looking for ?


HTH,

Tobias




More information about the R-help mailing list