Dear R-users,
i need to store in a variable a string made from levels of a factor
e.g.
a<-("a","a","b","b")
af<-factor(a)
mylevels<- ...a string with all the levels(af)
Thanks
--
DM
On Tue, 2006-04-18 at 17:52 +0200, Daniele Medri wrote:> Dear R-users, > > i need to store in a variable a string made from levels of a factor > > e.g. > > a<-("a","a","b","b")The above should be: a <- c("a","a","b","b") ^> af<-factor(a) > > mylevels<- ...a string with all the levels(af) > > Thanks > -- > DM> mylevels <- levels(af)> mylevels[1] "a" "b" See ?levels, which is listed in the "See Also" for ?factor. HTH, Marc Schwartz