Get species count from a dataframe
Value
The number of species. If obstype_col is provided, will
ignore all species with obstype_col value different from animal.
If keep_NA, will count NA in the total species count.
Examples
df <- data.frame(obstype = c("animal", "animal", "animal", "animal", "blank"),
                 species = c("cat", "cat", "cow", "dog", NA))
get_nspecies(df, spp_col = "species", obstype_col = "obstype")
#> [1] 3
