[R] working with tables

From: Carsten Steinhoff <carsten.steinhoff_at_gmx.de>
Date: Tue 22 Mar 2005 - 08:57:04 EST


two questions - I think simple to solve for you ...

(1) I've written a function containing some loops.
Each loop will generate a few outputs. Finally I have to combine them to get something like a "spreadsheet" that my colleagues can import in EXCEL.

Up to now I'm doing it as follows:

With each loop-step I assign new values for each "column" of my desired output like


At the end I combine all columns: my_table=cbind(column_A,column_B ... )

I think there should be another easier way to assign the new lines directly, isn't it?

(2) I often have to use the "fitdistr" function included in library MASS.

The generated output for e.g. $estimate has the following format:

      mean sd
  0.01664940 0.97682797

Now I want to write ONLY THE VALUE in a new variable. By doing

mean_a = ...$estimate[1]

I always have the string "mean" IN the variable. How can I eliminate this? Thanks a lot for your answer !


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 Received on Tue Mar 22 09:04:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:52 EST