From h.wickham at gmail.com  Mon Jul 31 13:42:23 2006
From: h.wickham at gmail.com (hadley wickham)
Date: Mon, 31 Jul 2006 12:42:23 +0100
Subject: [Rd] Warning when indexing data.frame with FALSE
In-Reply-To: <f8e6ff050607310441v1cd40ae0n6fb479cbd5a763a0@mail.gmail.com>
References: <f8e6ff050607310441v1cd40ae0n6fb479cbd5a763a0@mail.gmail.com>
Message-ID: <f8e6ff050607310442h16778689va0d70206042311e8@mail.gmail.com>

Sorry, a better example is:

> data.frame(a=1)[FALSE]
NULL data frame with 1 rows
> data.frame(a=1)[NULL]
NULL data frame with 1 rows

vs

> data.frame()[FALSE]
Warning in is.na(nm) : is.na() applied to non-(list or vector)
NULL data frame with 0 rows
> data.frame()[NULL]
Warning in is.na(nm) : is.na() applied to non-(list or vector)
NULL data frame with 0 rows

Hadley



[Rd] Warning when indexing data.frame with FALSE
hadley wickham