I have a column of catch rate data in a DF (df$catch.rate) that contains a combination of decimal values and zeros.
I would like to calculate the percentage of zero rows in the whole column to give me an indication of their contribution to the data.
I suggest using
%in%
if you haveNA
values..... e.g.There's probably a more R-ish way, but this is the quickest I could come up with.
will do the trick. You can add the argument
na.rm = TRUE
if there areNA
s.