Skip to content
Prev 299664 / 398503 Next

fill 0-row data.frame with 1 line of NAs

On 2012-07-10 06:57, Rui Barradas wrote:
Both this and Liviu's original solution destroy the
factor nature of 'Species' (which may not matter, of
course). How about

   (.xb <- iris[ iris$Species=='zz', ])
   .xb <- .xb[1, ]   # this probably shouldn't work, but it does.

?

Peter Ehlers