Giter Club home page Giter Club logo

sghosh89 / erc Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 660 KB

This repo is the complete workflow for this publication: Tail associations in ecological variables and their impact on extinction risk, Ghosh et al., Ecosphere 11(5):e03132. For details and citation see here:

Home Page: https://doi.org/10.1002/ecs2.3132

R 51.23% TeX 48.77%
extinction-risk-assessment tail-association extreme-events population-model copula age-structured-model metapopulation

erc's Introduction

Repository of analyses: Tail associations and their impact on extinction risk

Shyamolina Ghosh, University of Kansas

Lawrence W. Sheppard, University of Kansas

Daniel C. Reuman, University of Kansas

Introduction

This repository records the complete workflow that produced the paper. All analyses can be reproduced and the paper and supporting information recompiled (see below).

How to compile

Knit makefile.Rmd using R markdown. If all dependencies are in place (see next section) this should re-compute all analyses of the paper, resulting in three pdfs: MainText.pdf (the main text of the paper), SuppMat.pdf (the supporting information file for the paper), and makefile.pdf (notes on the compilation process - can be useful for error mitigation in the event of failure).

The knit may several hours, depending on your computer speed and other factors. Subsequent knits, if any, can be faster because packages will be installed (see below) and because intermediate results are cached.

If you try to knit MainText.Rmd or SuppMat.Rmd directly, you may have some success, but cross-document references and other features will fail so this is not recommended.

To compile the documents from the command line, use the following: Rscript -e "library(knitr); knit('makefile.Rmd')".

Dependencies

Core software dependencies

  • R
  • R markdown
  • R studio
  • latex
  • bibtex

Dependencies on the R checkpoint package

Code uses the R checkpoint package. This is set up in the master file makefile.Rmd in the R chunk checkpoint_chunk, which contains the following line of code specifying a date :

checkpoint("2019-01-13",checkpointLocation = "./")

The checkpoint package then automatically scans through other files looking for other required R packages. It then downloads and installs the newest versions of those packages available on the given date. This helps ensure that re-compiling the document uses exactly the same code that was originally used, in spite of package updates and other changes. This can take some time on first run (you are warned) but it is faster on subsequent runs because the packages are already installed. This also means that R package dependencies should only be the checkpoint package, since that package should scan for other packages and install them locally. Quite a few MB disk space are used (approx. 289).

Dependencies on pandoc

The open source program pandoc converts documents from one format to another. Here, the knitr package uses it to convert the markdown files into latex format so that they can then be turned into PDF files. Installers for multiple operating systems are available here: https://pandoc.org/installing.html.

Dependencies on pdflatex

The makefile makes a system call to pdflatex, so software supporting that needs to be installed:

Additional dependencies?

If you find additional dependencies were needed on your system, please let us know: [email protected]. The compilation process was tested on Ubuntu 16.04 using R version 3.4.4 and R studio version 1.1.463. We have endeavored to list all dependencies we can think of above, but we have only compiled on our own machines, so we cannot guarantee that additional dependencies will not also be needed on other machines. This repository is intended to record a workflow, and is not designed or tested for distribution and wide use on multiple platforms. It is not guaranteed to work on the first try without any hand-holding on arbitrary computing setups.

Intermediate files:

Knitting the makefile automatically produces a lot of 'intermediate' files. Files ending in .tex are the converted documents from .Rmd including all the R code output and the rest (files ending .log, .aux, .lof, .lot, .toc and .out ) are intermediate files that pdflatex uses to keep track of various parts of the document. Some of these can be useful for diagnosing problems, if any.

Acknowlegements :

The authors were partly funded by US National Science Foundation grant 1714195 and the James S McDonnell Foundation, and the California Department of Fish and Wildlife Delta Science Program. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation or the McDonnell Foundation or the California Department of Fish and Wildlife Delta Science Program.

erc's People

Contributors

reumandc avatar sghosh89 avatar

Stargazers

 avatar

Watchers

 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.