temp <- table(rpois(100,5),rpois(100,1)) temp temp[temp[,1] > 1,] temp[temp[,1] == 1,] temp[temp[,1] == 2,] temp[temp[,1] == 3,]
Of course you have not made it obvious if you are using the term table to mean any output that looks like a table, but in general terms you will find information in the documentation that comes with R, such as "An Introduction to R." In your case anything.you.like <- T[T[,1] == 1,] Tom > -----Original Message----- > From: K Fernandes [mailto:[EMAIL PROTECTED] > Sent: Thursday, 20 January 2005 7:15 AM > To: [email protected] > Subject: [R] How to filter information from a table into a new table > > > Hello, > > > > Say I have a table T as follows > > > > A b > > 1 2 > > 1 3 > > 2 2 > > 2 3 > > ...etc. > > > > And I would like create a table C from this existing table T, but only > including rows where A=1. > > > > How might I do this? > > > > Thanks, > > > > K - please reply to [EMAIL PROTECTED] as well as I am on > the digest > version :) > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
