Re: [R] Help converting a data.frame to ordered factors

2011-05-03 Thread Rob Cassidy
Hi again, Now that I have the data.frame as ordered factors, when I try to transpose it, I lose the factor orders. > datfact<-data.frame(c1,c2,c96) > sapply(datfact, class) c1c2c96 [1,] "ordered" "ordered" "ordered" [2,] "factor" "factor" "factor" > > dafacT<-as.data.

Re: [R] Help converting a data.frame to ordered factors

2011-05-03 Thread Rob Cassidy
Thanks, Phil. I could have sworn that I tried that (several times). It works perfectly, of course. Thanks again, Robert -- View this message in context: http://r.789695.n4.nabble.com/Help-converting-a-data-frame-to-ordered-factors-tp3490838p3492705.html Sent from the R help mailing list archive

Re: [R] Help converting a data.frame to ordered factors

2011-05-02 Thread Phil Spector
Robert - It would be helpful to know what you've tried that didn't work, but the data.frame() function is the usual way of combining things like this: a = factor(sample(1:5,100,replace=TRUE),ordered=TRUE) b = factor(sample(1:5,100,replace=TRUE),ordered=TRUE) ab = data.frame(a,b) sapply(ab,cla

[R] Help converting a data.frame to ordered factors

2011-05-02 Thread Robert Cassidy
I have a 96x34 array of Likert scale data (96 cases, 34 items) of ordered factors (strongly disagree, disagree, neutral, agree, strongly agree) that are coded numerically (1 through 5). I cannot seem to convert this array (in any class) into ordered vectors. I have all the cases as vectors of ord