Skip to content
Prev 300166 / 398503 Next

variable (column) in a data frame

This seems more or less correct to me.

1> sum(df$a==1)
[1] 1
1> sum(df$a==2)
[1] 1
1> sum(df$aaa==2)
[1] 0

There is no df$aaa so the length is 0 which is what I think you are asking.
What am I missing?


John Kane
Kingston ON Canada
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM?, MSN? Messenger, Yahoo!? Messenger, ICQ?, Google Talk? and most webmails