-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
116 lines (90 loc) · 3.17 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
```{r, echo=FALSE, message=FALSE, warning=FALSE}
library(eve)
```
# eve <a href='https://github.com/EvoLandEco/eve/'><img src='man/eve-logos/eve-logos_transparent.png' align="right" height="139" /></a>
[![CRAN
status](https://www.r-pkg.org/badges/version/eve)](https://cran.r-project.org/package=eve)
[![R build
status](https://github.com/DEvoLandEco/eve/workflows/R-CMD-check/badge.svg)](https://github.com/EvoLandEco/eve/actions)
[![DOI](https://zenodo.org/badge/382378337.svg)](https://zenodo.org/badge/latestdoi/382378337)
## Overview
The package `eve` is an evolution emulator which provides pipelines to
do phylogenetic-diversity-dependent simulation, analyse outputs and
generate publication-ready plots and statistics conveniently.
`eve` supports mainly three different scenarios, the species diversification process is regulated by ***phylogenetic diversity (PD)*** or ***evolutionary distinctiveness (ED)*** or ***nearest neighbor distance (NND)*** respectively.
`eve` supports parallel computing , this feature is implemented with [furrr](https://furrr.futureverse.org/), read through its documentation before using this feature. Note that parralel computing may use a huge amount of memory and may have large overhead.
## Installation
You can install the developmental version from
[GitHub](https://github.com/) by running the following commands in R console:
``` r
# install.packages("remotes")
remotes::install_github("EvoLandEco/eve")
```
## Example
```{r combo}
library(eve)
# make a combo of parameter sets
combo <- edd_combo_maker(
la = c(0.5, 0.8),
mu = c(0.1, 0.2),
beta_n = c(-0.001, 0),
beta_phi = c(-0.001, 0.001),
gamma_n = c(-0.001, 0.001),
gamma_phi = c(-0.001, 0.001),
age = 5,
model = "dsde2",
metric = c("ed"),
offset = "none"
)
# have a look at the combo
combo[1:3]
```
All the unique and possible combinations of parameters will be created automatically.
`eve` supports parallel simulation, the following example shows how to do an 8-session parallel EDD simulation given the combo, with 3 replications for each parameter set . The result will be saved to `/result/example`. If `name` is not specified, a folder will be created according to time and date at the moment.
```{r edd_go}
# result will be save as .RData file
# edd_go(
# combo = combo,
# nrep = 3,
# name = "example",
# strategy = future::multisession,
# workers = 8
# )
```
`edd_go` will not return any object unless you set `name = "no_save"`.
```{r}
# set name = "no_save" if you want to assign the output to a variable
# output <- edd_go(
# combo = combo,
# nrep = 3,
# name = "no_save",
# strategy = future::multisession,
# workers = 8
# )
# examine the result
# output[[1]]
```
Sequential simulation is also possible:
```{r sequential}
# edd <- edd_go(
# combo = combo,
# nrep = 3,
# name = "example2",
# strategy = future::sequential,
# workers = 8
# )
```