[R] How to append to a data.frame?

David Kreil kreil at ebi.ac.uk
Tue Dec 9 08:22:30 CET 2003


Yes, once I've named the first column, I can add further ones by saying 
d[c("x","y","z")]=NA or such. I was just wondering whether that was the way to 
do it or whether there was a more elegant approach. Preallocation was the 
critical clue I needed.

Thanks again for your help,

David.


------------------------------------------------------------------------
Dr David Philip Kreil                 ("`-''-/").___..--''"`-._
Research Fellow                        `6_ 6  )   `-.  (     ).`-.__.`)
University of Cambridge                (_Y_.)'  ._   )  `._ `. ``-..-'
++44 1223 764107, fax 333992         _..`--'_..-_/  /--'_.' ,'
www.inference.phy.cam.ac.uk/dpk20   (il),-''  (li),'  ((!.-'




More information about the R-help mailing list