Re: [R] accessing a table

About this list Date view Thread view Subject view Author view Attachment view

From: Thomas Lumley (tlumley@u.washington.edu)
Date: Wed 11 Jul 2001 - 05:46:41 EST


Message-id: <Pine.A41.4.33.0107101244460.15808-100000@homer18.u.washington.edu>

On Tue, 10 Jul 2001, Greg Trafton wrote:

> Hi, all. I'm sure this is a simple question, but I'm having problems
> figuring it out myself... I have a table:
>
> > currenttable <- table(junk[-1],junk[-n])
> > currenttable
>
> bar foo junk
> bar 2 2 0
> foo 1 0 0
> junk 0 0 1
>
> and I'd like to know the result of the cell currenttable(bar,foo).
>
> what is the best way to get that result?

currenttable["bar","foo"]

I think you would be well advised to work through the "Introduction to R"
manual, which will answer a lot of basic questions about programming.

        -thomas

Thomas Lumley Asst. Professor, Biostatistics
tlumley@u.washington.edu University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Wed 10 Mar 2004 - 08:18:19 EST