On Tue, 9 Dec 2003, David Kreil wrote: > 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.
Use an initial data.frame call naming all the columns. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help