I have variable in a dataframe that contains values between -70 and 78. If I use the summary()
function, I get a summary with all the numbers included (as expected). Is it possible to run summary()
ONLY on the positive numbers (>0) within that variable?
Yes, it's possible.
The code below works, assuming your data frame is called myData and the column you want to filter (to values >0) is called x.
summary(myData[myData$x>0,])
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments