[R] save contigency table

Liaw, Andy andy_liaw at merck.com
Wed Jan 26 15:31:29 CET 2005


Try something like:

  write.table(unclass(tabelle), "data.txt", row=T, col=T, quote=F, sep=";")

HTH,
Andy

> From: Helmut Kudrnovsky
> 
> Content-Type: text/plain; charset="iso-8859-1"
> Received-SPF: none (hypatia: domain of hellik at web.de does not 
> designate permitted sender hosts)
> X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch
> Content-Transfer-Encoding: 8bit
> X-MIME-Autoconverted: from quoted-printable to 8bit by 
> hypatia.math.ethz.ch id j0QDdhgh026614
> X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on 
> hypatia.math.ethz.ch
> X-Spam-Level: 
> X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 
> autolearn=no version=3.0.2
> 
> hi R-friends,
> 
> i build a contigency table with the function table()  which 
> looks like:
> 
>                  LAGECODE
> BID                            1 2 10 11 12 13 14 15 19 21 22 
> 23 24 31 32 46 47 54 56 57 62 67 70 71 80 81 82 430 460 ........
>   200310413290143  0 0 0  0  0  1  0  0  0  0  0  0  0  0  0  
> 1  0  0  0  0  1  1  0  0  0  0  1  0   0  ...
>   200310413290144  0 0 0  0  0  1  0  0  0  0  0  0  0  0  0  
> 0  0  0  0  0  0  1  0  0  0  0  0  0   0 ...   
>   200310413290145  0 0 0  0  0  0  0  0  1  0  0  0  0  0  0  
> 0  0  0  0  0  0  0  0  0  0  1  0  0   0 .... 
>   200310413290146  0 0 0  0  0  1  0  0  1 .....
> .
> .
> .
> 
> 
> i want to save this contigency table in a text-file. i tried 
> the function write.matrix(tabelle, file="data.txt", sep=";") 
> with following result in the text-file:
> 
> 1;2;10;11;12;13;14;15;19;21;22;23;24;31;32;46;47;54;56;57;62;6
> 7;70;71;80;81;82;430;460
> 0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;1;0;0;0;0;1;1;0;0;0;0;1;0;0
> 0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0
> 0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;0
> 
> is it possible the get an text-file including BID in the 
> first column?  i´ve studied the R-help, but i couldn´t find 
> any information about this.
> 
> platform i386-pc-mingw32
> arch     i386           
> os       mingw32        
> system   i386, mingw32  
> status                  
> major    2              
> minor    0.0            
> year     2004           
> month    10             
> day      04             
> language R              
> 
> with thanks in advance
> greetings
> helli
> 
> ______________________________________________
> R-help at 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
> 
>




More information about the R-help mailing list