Description Usage Arguments Value Examples
summarize functional groups
1 2 | sum_func_groups(merged_data, grps = list(~site, ~site_brom.id, ~predation,
~functional_group))
|
merged_data |
data formed by merging insect data to trait data |
grps |
using the formula, indicate the grouping factors required |
summarized data. NOTE that this data will be grouped!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | invert_data <- combine_tab(c("Argentina", "French_Guiana", "Colombia","Macae", "PuertoRico","CostaRica"),"bromeliad.final.inverts")
bwg_names <- get_bwg_names()
invert_traits <- merge_func(invert_data, bwg_names)
# Functional Groups
func_groups <- sum_func_groups(invert_traits,
grps = list(~site,
~site_brom.id,
~functional_group))
func_groups
library(ggplot2) #require the 'ggplot2' package
## plot by functional group abundance
func_groups %>%
ggplot(aes(x = as.factor(functional_group), y = total_abundance)) +
geom_point(position = position_jitter(width = 0.25), alpha = 0.5) +
stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 0.6) +
facet_wrap(~site, scales = "free_y") +
ggtitle("Functional group abundance")
# Trophic level
# To summarize by trophic level group, simply switch \code{~functional_group} to \code{~predation}:
predprey <- sum_func_groups(invert_traits,
grps = list(~site,
~site_brom.id,
~predation))
predprey
## plot by trophic level abundance
predprey %>%
ggplot(aes(x = as.factor(predation), y = total_abundance)) +
geom_point(position = position_jitter(width = 0.25), alpha = 0.5) +
stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 0.6) +
facet_wrap(~site, scales = "free_y") +
ggtitle("Trophic level abundance")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.