Re: [R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 12:13 -0500, Michael Rennie wrote: > Hi, there > > I'm currently trying to figure out how to keep my "factor" levels for a > variable when moving it from one data frame or matrix to another. > > Example below: > > vec1<-(rep("10",5)) > vec2<-(rep("30",5)) > vec3<-(rep("80"

Re: [R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Chuck Cleland
Michael Rennie wrote: > Hi, there > > I'm currently trying to figure out how to keep my "factor" levels for a > variable when moving it from one data frame or matrix to another. > > Example below: > > vec1<-(rep("10",5)) > vec2<-(rep("30",5)) > vec3<-(rep("80",5)) > vecs<-c(vec1, vec2, vec3) >

[R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Michael Rennie
Hi, there I'm currently trying to figure out how to keep my "factor" levels for a variable when moving it from one data frame or matrix to another. Example below: vec1<-(rep("10",5)) vec2<-(rep("30",5)) vec3<-(rep("80",5)) vecs<-c(vec1, vec2, vec3) resp<-rnorm(2,15) dat<-as.data.frame(cbind(