Subscript out of bounds on a which statement in R

Posted by ahandler on Stack Overflow See other posts from Stack Overflow or by ahandler
Published on 2013-10-28T03:21:54Z Indexed on 2013/10/28 3:54 UTC
Read the original article Hit count: 103

Filed under:

I have data that looks like this:

> head(newdata)
          zero       one real
601 0.01273885 0.9872611    1
602 0.01273885 0.3242234    1

I want to select records where one is greater than .5

When I try this, I get "subscript out of bounds." Why am I getting this error? How do I perform this select?

newDataGoodPredict <- newdata[ which(one>0.5),] Error in newdata[which(one > 0.5), ] : subscript out of bounds

© Stack Overflow or respective owner

Related posts about r