Skip to content
Prev 64953 / 398498 Next

Loops and dataframes

An addendum:  If you must use a data frame (e.g., you have mixed data
types), the following might help:
+              df <- as.data.frame(df)}, gcFirst=TRUE)
[1] 0.14 0.01 0.15   NA   NA

I.e., keep it as a list until all manipulations are done, then coerce to
data frame.


Andy