-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
70 lines (46 loc) · 2.9 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: "North and Central American Mammals Functional Rarity Read Me"
author: "Matthias Grenié, Pierre Denelle, Caroline Tucker, François Munoz and Cyrille Violle"
date: "`r Sys.Date()`"
output: rmarkdown::github_document
always_allow_html: yes
bibliography: refs.bib
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, fig.path = "README_figs/README-")
```
## Goal
This repository contains a worked through example of the use of [`funrar`R package](https://cran.r-project.org/package=funrar) in the context of biogeography using a publicly available dataset on North and Central American mammals [@lawing_community_2016; @lawing_data_2016]. The functional traits are taken from [@jones_pantheria:_2009] database.
The dataset is available through Dryad there: [doi:10.5061/dryad.9t0n8](https://doi.org/10.5061/dryad.9t0n8).
The functional traits metadata are available on the [Ecological Archives Repository](http://esapubs.org/archive/ecol/E090/184/).[@jones_pantheria:_2009]
The repository is self-contained and can be used to automatically download [see How to run section](#how-to-run) and compute the figures shown in the submitted manuscript.
## How to run
To run the analysis on your computer, install `remake` ([see Dependencies section](#dependencies)), move to the project directory and run:
```
remake::make()
```
You will see the full analysis run on your computer, it can take as long as 15 minutes to run. And you will need to be connected to the internet at least to download the primary data files.
With remake all the intermediate objects are viewable on a dependency graph:
```{r}
remake::diagram()
```
## Organization
The repository is organized with the `scripts` folder which contains R files to run the analysis. Each R file contains functions used in the `remake.yml` file for each step of the analysis.
The `results` folder contains the `exploratory_analysis.Rmd` file which sums up the results and plot graphs based on the computation done when running the scripts.
The `data` folder is created when downloading the datafiles.
## Dependencies
The analysis strongly depends on several packages:
* [`remake`](/~https://github.com/richfitz/remake) to make the analysis portable and reproducible,
* [`dplyr`](/~https://github.com/hadley/dplyr) for data wrangling,
* [`rdryad`](/~https://github.com/ropensci/rdryad) to download the data from Dryad,
* [`rmarkdown`](/~https://github.com/rstudio/rmarkdown/) to generate the analysis report,
* [`vegan`](/~https://github.com/vegandevs/vegan) to compute null models for site-species matrix,
* [`ggplot2`](/~https://github.com/tidyverse/ggplot2) to plot figures in reports,
* [`devtools`](/~https://github.com/hadley/devtools) for session info diagnostics,
* [`funrar`](https://cran.r-project.org/package=funrar) to compute functional rarity indices.
## Session Info
The analysis ran using the following system and packages:
```{r}
devtools::session_info()
```
## References