Re: [R] Convert Contingency Table to Flat File

From: Philipp Pagel <philipp.pagel.lists_at_t-online.de>
Date: Tue 17 Oct 2006 - 11:09:34 GMT

On Tue, Oct 17, 2006 at 03:08:49AM -0700, Marco LO wrote:
> Is there any R function out there to turn a multi-way contingency
> table back to a flat file table of individual rows and attribute
> columns.?

Are you looking for something like this?

# generate some data

x = sample(c(0,1), 100, replace=T)
y = sample(c(0,1), 100, replace=T)
z = sample(c(0,1), 100, replace=T)

# contingency table
mytab = table(x,y,z)
# flat contingency table
as.data.frame( mytab )

cu

        Philipp

-- 
Dr. Philipp Pagel                            Tel.  +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics      Fax.  +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany

 and

Institute for Bioinformatics / MIPS          Tel.  +49-89-3187 3675
GSF - National Research Center               Fax.  +49-89-3187 3585
      for Environment and Health
Ingolstädter Landstrasse 1
85764 Neuherberg, Germany
http://mips.gsf.de/staff/pagel

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Oct 17 21:21:25 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 17 Oct 2006 - 19:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.