Skip to content

jasminalbert/AsymmetricRelationshipsAndCoexistence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

678 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Code repository for the paper "Asymmetric relationships and their effects on coexistence"

Pimsupa Jasmin Albert, University of Kansas and University of Oregon
Daniel C. Reuman, University of Kansas

Introduction

This repository can be used to reproduce the complete analyses behind the paper ``Asymmetric relationships and their effects on coexistence" and to recompile the latex for the paper itself. The paper is now published in Ecology Letters.

How to run analyses and compile paper

To reproduce the analyses: 1) make your R working directory the code directory; 2) run MASTER.R. If all dependencies are in place (see next section) then all results supporting the paper will be saved to the results directories. This will take some time (a day or two, possibly longer, depending on your computer speed). Multiple cores will be needed, and things will, of course, be slower if your machine does not have those cores available.

To compile the paper latex, open paper/Paper.Rnw and paper/SupMat.Rnw and compile them using Sweave. If you are using Rstudio and if it is configured to work with Sweave, this will just be a button in Rstudio entitled ``Compile PDF''. All figures and other results generated by the code will be automatically imported into the paper.

Dependencies

Core dependencies

Core dependencies are R, R studio configured to compile Sweave documents, latex and bibtex. We used R version 4.3.0 running on Ubuntu Linux 18.04.6 and R version 4.2.1 on macOS Monterey 12.6.1.

Required libraries include: MASS (7.3-59), stats (4.3.0), graphics (4.3.0), grDevices (4.3.0), copula (1.1-2), parallel (4.3.0), plot3D (1.4) and deSolve (1.36). To ensure that re-compiling the document uses the same code that was originally used, use the same R and package versions.

Certain intensive bits of the code make use of the mclapply function in the parallel package to utilize multiple compute cores. Seven cores are used. Search for parallel::mclapply in diatom/fig5def_fxns.R where you can change this number if you want to devote more or fewer cores. This approach to multicore processing only works on linux. If you are running Windows or Mac, it may work very slowly (with one core only, for instance) or not at all, no guarantees, good luck!

Additional dependencies?

If you find additional dependencies were needed on your system, please let us know: reuman@ku.edu. We have endeavored to list all dependencies we can think of above, but we have only run this 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 machines. It is not guaranteed to work without any (possibly substantial) hand-holding on arbitrary computing setups.

Intermediate files:

Compiling the Sweave documents paper/Paper.Rnw and paper/SupMat.Rnw automatically produces a lot of ``intermediate'' files with extensions such as .aux, `.bbl`, `.log`, etc. Some of these can be useful for diagnosing problems, if any. Delete these at your own risk.

Acknowlegements

The authors thank Shyamolina Ghosh for suggesting the research problem, and Lawrence Sheppard, Max Castorani, Jon Walter, Jude Kastens, Vadim Karatayev, Emily Arsenault, Jordan Rodriguez, Lauren Hallett, Madelon Case, Chhaya Werner, Lina Aoyama, Steven Haring, Carmen Watkins, Robin Snyder, and three anonymous referees and the editor for helpful feedback. The authors especially thank Steve Ellner for key advice at several watershed moments in the development of the project. The authors were partly supported by US National Science Foundation grants 1714195 and 2023474, the James S McDonnell Foundation, the California Department of Fish and Wildlife Delta Science Program, and the Alexander von Humboldt Foundation. 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 other funders.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •