[R] working with tables

Carsten Steinhoff carsten.steinhoff at gmx.de
Mon Mar 21 22:57:04 CET 2005


Hi,

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

colum_A=c(column_A,new_value)

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 !

Carsten




More information about the R-help mailing list