library(tidyverse)
mammals <- mammal_data
orders <- mammals %>%
    filter(order == 'Artiodactyla' | order == 'Carnivora' | order == 'Cetacea' | order == 'Insectivora' | order == 'Lagomorpha' | order == 'Primates' | order == 'Rodentia' )
orders %>%
    mutate(offspring.year = litter.size * litters.year) %>% 
    ggplot(aes(x=offspring.year, y=weaning.mo.)) +
               geom_point() +
    geom_smooth(method='loess', alpha=0.5)

correlation between offspring/year and weaning time

orders %>%
    ggplot(aes(x=gestation.mo., y=weaning.mo.)) +
    geom_point() +
    geom_smooth(method='loess', alpha=0.5)

correlation between gestation time and weaning time

orders %>%
    ggplot(aes(x=AFR.mo., y=max..life.mo.)) +
    geom_point() +
    geom_smooth(method='loess', alpha=0.5)

correlation between age of first reproduction and adult lifespan

orders %>%
    mutate(offspring.year = litter.size * litters.year) %>%
    ggplot(aes(x=AFR.mo., y=offspring.year)) +
    geom_point() +
    geom_smooth(method='loess', alpha=0.5)

correlation between age of first reproduction and offspring/year

orders %>%
    ggplot(aes(x=max..life.mo., y=AFR.mo.)) +
    geom_point() +
    geom_smooth(method='loess', alpha=0.5)

correlation between max lifespan and age of first reproduction

orders %>%
    mutate(offspring.year = litter.size * litters.year) %>%
    ggplot(aes(y=max..life.mo., x=offspring.year)) +
    geom_point()

correlation between offspring/year and max lifespan



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