[Rd] Warning when indexing data.frame with FALSE

hadley wickham h.wickham at gmail.com
Mon Jul 31 13:42:23 CEST 2006


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



More information about the R-devel mailing list