R: returning the minimum positive number

Viewed 5167

I have a dataframe with positive and negative numbers. What I need to return is the smallest positive number. Is there a function that does this?

 dfcount  <- data.frame(A=c(1,2,3,4,-5,-6,-7))

ie minpositive(dfcount) returns 1 and not -7

Thank you for your help

2 Answers
Related