possible analysis

required pachage and modification on file

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"))

possible figure

    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))

Possible results tables

-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()


UofTCoders/eeb430.2017.JuniorCoders documentation built on May 28, 2019, 3:19 p.m.