Re: [R] how to force a table to be square?

2010-07-22 Thread Peter Ehlers
On 2010-07-22 10:43, Wu Gong wrote: Hi William, I'm curious about that you used d[]<- lapply(d, factor... Could you please tell me if there are any differences between d[] and d? Thank you. Why not try it both ways and inspect the result. d[] <- d <- Obvious? -Peter Ehlers

Re: [R] how to force a table to be square?

2010-07-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Wu Gong > Sent: Thursday, July 22, 2010 9:44 AM > To: r-help@r-project.org > Subject: Re: [R] how to force a table to be square? > > > Hi William,

Re: [R] how to force a table to be square?

2010-07-22 Thread Wu Gong
Hi William, I'm curious about that you used d[] <- lapply(d, factor... Could you please tell me if there are any differences between d[] and d? Thank you. - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298965.html

Re: [R] how to force a table to be square?

2010-07-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Liat > Sent: Thursday, July 22, 2010 8:41 AM > To: r-help@r-project.org > Subject: Re: [R] how to force a table to be square? > > > Thanks Peter! >

Re: [R] how to force a table to be square?

2010-07-22 Thread Liat
Thank you!!! -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298876.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] how to force a table to be square?

2010-07-22 Thread Liat
Thanks Peter! that worked, and was so easy. LOL. I tried playing with factor and levels before I wrote here, but obviously I didn't do it right. Thanks again, Liat. -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298875.html Sent from t

Re: [R] how to force a table to be square?

2010-07-22 Thread Wu Gong
Hi, try ?levels myData <- matrix(sample(c(LETTERS[1:10],NA),100,replace=T),nrow=25) table(factor(as.vector(myData),levels=LETTERS[1:26]),useNA="ifany") - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298833.html Se

Re: [R] how to force a table to be square?

2010-07-22 Thread peter dalgaard
On Jul 22, 2010, at 4:00 PM, Liat wrote: > > Hi guys, > I hope you can help me with this. > Here is the problem: > I have some data (myData) that looks similar to this: > > [,1] [,2] [,3] [,4] > [1,] "A" "A" "B" "B" > [2,] "B" "B" "B" "B" > [3,] "C" "C" "C" "C" > > When I build

[R] how to force a table to be square?

2010-07-22 Thread Liat
Hi guys, I hope you can help me with this. Here is the problem: I have some data (myData) that looks similar to this: [,1] [,2] [,3] [,4] [1,] "A" "A" "B" "B" [2,] "B" "B" "B" "B" [3,] "C" "C" "C" "C" When I build a contingency table for the first and second row using: tb <- tab