Skip to content

Instantly share code, notes, and snippets.

@Myfanwy
Last active January 17, 2021 19:37
Show Gist options
  • Save Myfanwy/2445f0972f0f6a65d75a0750fdecf779 to your computer and use it in GitHub Desktop.
Save Myfanwy/2445f0972f0f6a65d75a0750fdecf779 to your computer and use it in GitHub Desktop.
Preps your system for the things we'll be doing in the training session on Wed
install.packages(c('rmarkdown',
'knitr',
'lubridate',
'ggplot2',
'data.table',
'readxl',
'RSQLite',
'dplyr'
)
)
#------------------------------------------------------------------
# function to calculate fish condition - you will copy and paste this to your utils.R script:
condition = function(weights, lengths) {
if(any(lengths == 0 | weights == 0)) stop("some value(s) are 0")
num = 1e5*weights
den = lengths^3
K = num/den
return(K)
}
#-----------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment