I have a simple two column dataframe.
> CodHorseMackerel
# A tibble: 2,352 x 2
Gadus.morhua Trachurus.trachurus
<dbl> <dbl>
1 84 0
2 4 386
3 100 0
4 15 0
5 36 24
6 0 4
7 8 176
8 37.5 112.
9 3 1242
10 2 608
I want to filter and remove entries where values for both are 0. I do not want to remove all 0's, only rows where both Gadus.morhua and Trachurus.Trachurus = 0. I am struggling to apply the filter correctly.
I tried filter_all, and it didn't work correctly.
filter_all(CodHorseMackerel, any_vars(. < 1))
So I tried filter_if instead
filter_if(CodHorseMackerel, any_vars(. < 1))
Error in selected[[i]] <- eval_tidy(.p(column, ...)) :
more elements supplied than there are to replace
Help please!