I have a variable (Var) which stores 10000 values and is of integer nature.
I want to count, how many times 1000 or higher than 1000 numeric value occurs in this list.
Any one liner in R?
Thank you in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
sum(Var >= 1000)will do it, as long asVaris a vector. If not, you’ll need to tell R to findVarinside whatever object contains it. Here is an example:This uses the fact that
TRUE= 1 andFALSE= 0.