knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

fisHeat

The goal of fisHeat is to predict the growth of juvenile salmon under different temperature and prey availability scenarios.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("coreyphillis/fisHeat")

Example

Predict the new mass after 30 days for fish of given starting size and different prey density and temperature.

library(fisHeat)

set.seed(12345)

df <- data.frame(mass0 = runif(20, 1, 5),
                 prey_density = runif(20, .1, 60),
                 temperature = runif(20, 10, 20),
                 days = rep(30,10))


df$newmass <- newmass_fxn(df, df$mass0, df$days)

# mass specific growth (grams per gram per day)
df$ggd <- df$newmass/df$mass0/df$days
head(df)
library(ggplot2)
library(viridis)

ggplot(df, aes(prey_density, ggd)) + 
  geom_point(aes(size = mass0, color = temperature)) + 
  scale_x_log10(limits = c(0.01, 60)) + ylim(c(0,0.15)) +
  scale_color_viridis(aesthetics = c('color', 'fill'), option = 'viridis', alpha = 0.6, limits = c(10,20)) + 
  xlab('Prey Density') + 
  ylab('grams per gram per day')


coreyphillis/fisHeat documentation built on Dec. 31, 2020, 10:07 p.m.