Re: [R] Are you sure a table can become a data.frame?

2008-11-16 Thread Gabor Grothendieck
Try: as.data.frame.matrix(table(X)) On Sun, Nov 16, 2008 at 1:28 PM, CE.KA <[EMAIL PROTECTED]> wrote: > > Hi R users, > > Imagine X as a data frame: > > X=read.table(textConnection(" > Var1 Var2 > 1 A H > 2 B K > 3 A H > 4 B H > 5 C L > "),header=TRUE) > closeAllConnections() > > X

[R] Are you sure a table can become a data.frame?

2008-11-16 Thread CE.KA
Hi R users, Imagine X as a data frame: X=read.table(textConnection(" Var1 Var2 1 A H 2 B K 3 A H 4 B H 5 C L "),header=TRUE) closeAllConnections() XX is a data frame Var1 Var2 1AH 2BK 3AH 4BH 5CL Y<-table