Coder Social home page Coder Social logo

chandlerlester / bycatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grantmcdermott/bycatch

0.0 1.0 0.0 148.23 MB

Data and R code for reproducing "Protecting marine mammals, turtles, and birds by rebuilding global fisheries".

Home Page: http://science.sciencemag.org/content/359/6381/1255

R 100.00%

bycatch's Introduction

Protecting marine mammals, turtles, and birds by rebuilding global fisheries

DOI

This repo contains data and R code for reproducing Burgess et al. (2018), "Protecting marine mammals, turtles, and birds by rebuilding global fisheries". Click on the "fork" button at the very top right of the page to create an independent copy of the repo within your own GitHub account. Alternately, click on the green "clone or download" button just below that to download the repo to your local computer.

The main file for conducting the analysis is R/bycatch.R. This file contains self-explanatory code for easily reproducing the results from the ten different model runs described in the paper, as well as all of the figures.

Requirements

The entire analysis is conducted in the R programming environment. R is free, open-source and available for download here. We highly recommend running R in the RStudio IDE, which you can also download for free here.

You will need to install a number of external R packages to run the code successfully. These are listed at the top of the main R/bycatch.R file. An easy way to ensure that you have the correct versions of all the packages is to run the following code chunk in your R console:

if (!require("pacman")) install.packages("pacman")
pacman::p_install(data.table, pbapply, parallel, R.utils, truncnorm, scales, grid, rworldmap, sf, rgeos, tidyverse, forcats, cowplot, ggthemes, RColorBrewer, viridis, extrafont, here)
devtools::install_github("tidyverse/ggplot2") ## Using dev. version of ggplot2 for geom_sf()
pacman::p_update()

Please note that the extrafont package requires some minor setup upon first use. The main analysis will still work without this initial setup, but it is perhaps useful for reproducing some of the figures in full. See here for instructions.

Performance

The core analysis in this paper involves a series of computationally intensive Monte Carlo simulations. The code is optimized to run in parallel and will automatically exploit any multi-core capability on your machine. That being said, even on a 24 core Linux server, a single model run can take around 40 minutes to complete. (See here for a tutorial on how to set up your own personal server using Google Compute Engine, complete with R and RStudio Server.) We strongly suggest reducing the "n1" and "n2" parameters (+/- line 75 in R/bycatch.R) before running the analysis on a local machine with few CPUs. Failing that, the saved results from our own model runs can be found in the Results sub-directory.

Problems

If you have any trouble running the code, or find any errors, please file an issue on this repo and we'll look into it.

License

The software code contained within this repository is made available under the MIT license. The data and figures are made available under the Creative Commons Attribution 4.0 license.

bycatch's People

Contributors

grantmcdermott avatar mattgburgess avatar bowashi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.