Skip to content
Back to formatted view

Raw Message

Message-ID: <CABxs9VkNgjjvSRLGua3qW33xxtaSZrYZjYEKaGKnJqFiJ9LZPg@mail.gmail.com>
Date: 2012-07-11T06:58:50Z
From: Liviu Andronic
Subject: fill 0-row data.frame with 1 line of NAs
In-Reply-To: <4FFC41F7.3030105@ucalgary.ca>

On Tue, Jul 10, 2012 at 4:53 PM, Peter Ehlers <ehlers at ucalgary.ca> 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.
>
This one is an excellent solution, but yet another---what I
call---quirky behaviour from R.

Thanks all! Regards
Liviu