1

I have a data frame of about 10,000,000 entries. There's only two columns: 'value' and 'deleted'. The values usually range from 1:1800, but also there's some odd strings. Deleted is a boolean indicating whether the value was deleted. If I copy this data frame with the condition

deletedFrame <- df[df$deleted!=0, ]

the resulting data frame reduces to 283 entries. However, it doesn't copy over any of the corresponding values. That column is there but is left blank. Any ideas on what I'm doing wrong?

thelatemail
  • 91,185
  • 12
  • 128
  • 188
Ola Linguori
  • 11
  • 1
  • 1
  • 2
    One fix might be to post a reproducible example.... http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Nate Jul 27 '16 at 02:02

1 Answers1

0

It could be a case where we have NA along with the boolean, one way would be to use

df[df$deleted!=0 & !is.na(df$deleted), ]
akrun
  • 874,273
  • 37
  • 540
  • 662