d_mmi <- d_mmi %>%
    left_join(d_ambi, by = "TAXON") %>%
    rename(AMBI_GROUP = GROUP)
if (is.null(d_ambi)) {
    d <- d_mmi %>% 
        filter(!has_ambi(taxon = TAXON)) %>%
        select(TAXON) %>%
        group_by(TAXON) %>%
        summarise(N_RECORDS = n())
} else {
    d <- d_mmi %>% 
        filter(!has_ambi(taxon = TAXON, group = AMBI_GROUP)) %>%
        select(TAXON) %>%
        group_by(TAXON) %>%
        summarise(N_RECORDS = n())
}
cat(sprintf("\nThe AMBI-class is missing for the following %i taxa:\n", nrow(d)))
d %>%
    xtable %>%
    print(type = "html",  include.rownames = FALSE)


Try the BENMMI package in your browser

Any scripts or data that you put into this service are public.

BENMMI documentation built on Oct. 23, 2020, 8:24 p.m.