# MMI has been designed for endofauna, therefore remove 
# epifaunal species and insecta

d_mmi <- d_mmi %>% 
    left_join(d_taxa %>% select(accepted, group) %>% distinct, by = c("TAXON" = "accepted")) %>%
    left_join(d_groups, by = c("group" = "GROUP"))

d <- d_mmi %>%
    select(DESCRIPTION) %>%
    filter(!is.na(DESCRIPTION)) %>%
    group_by(DESCRIPTION) %>%
    summarise(COUNT = n()) %>%
    full_join(d_groups, by = "DESCRIPTION") %>%
    mutate(COUNT = as.integer(ifelse(is.na(COUNT), 0, COUNT))) %>%
    select(GROUP, DESCRIPTION, COUNT) %>%
    arrange(GROUP)

# remove black-listed species from benthos data 
# (i.e., those not in d_groups, hence description is missing)
d_mmi <- d_mmi %>%
    filter(is.na(DESCRIPTION)) %>%
    select(-DESCRIPTION, -group)
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.