[R] omitting integer(0) rows from data frame

Jack Tanner ihok at hotmail.com
Wed Oct 30 14:04:13 CET 2013


I'm not sure if this is correct behavior or not, but it seems counterintuitive 
to me:

dat <- data.frame(id=1:5, let=letters[1:5])
# A. omits the first row
dat[- 1, ]

# B. unexpectedly omits ALL rows
dat[- integer(0), ]

It would be less surprising if there were no rows omitted in the (B) case.



More information about the R-help mailing list