library(ggplot2) library(dplyr)
library(readr) marine <- read_csv("../data/Predator_and_prey_body_sizes_in_marine_food_webs_vsn4.csv") View(marine)
marine2 <- plyr::rename(marine,c( "Type of feeding interaction" = "feeding_type", "Predator standard length" = "predator_standars_length", "Mean annual temp" = "temp", "Predator mass" = "predator_mass", "Prey mass" = "prey_mass","Predator taxon" = "Predator_taxon","Geographic location" = "geographic", "Specific habitat" = "habitat"))
g <- ggplot(marine2, color = predator_taxon) g+ geom_boxplot(aes(x = feeding_type, y = predator_mass))+ ylim(0,5000)
facet by taxon/species can also be added.
g + geom_point(aes(x = log(prey_mass), y = log(predator_mass)))+ geom_smooth(aes(x = log(prey_mass), y = log(predator_mass)),method = "glm")+ facet_wrap(~feeding_type)
g+ geom_point(aes(x = temp, y = predator_mass))
-frequency of each feeding type/ location
marine2 %>% group_by(feeding_type) %>% tally() marine2 %>% group_by(geographic) %>% tally() marine2 %>% mutate(habitat=gsub("Coastal bay", "Coastal Bay", habitat)) %>% mutate(habitat=gsub("shelf", "Shelf", habitat)) %>% group_by(habitat) %>% tally()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.