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
mean(!df$catch.rate)
will do the trick. You can add the argument na.rm = TRUE if there are NAs.
na.rm = TRUE
NA