ustroetz ustroetz - 3 months ago 17
R Question

R count observations greater than

I have a dataset

output
in R with a the variables
V1
,
V2
,
V3
,
V4
. How can I get the number of observations in
V4
that area greater than 2000?

Answer

Try using logical test and then sum over the values meeting the condition

sum(output$V4 > 2000)