-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23bc4fc
commit 1cdbc7b
Showing
3 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
# PhyloSim | ||
|
||
A model, provided as an R package, for the simulation of spatially explicit biogeographical and phylogenetic data. | ||
|
||
### Installation | ||
|
||
You can install directly from gh, using the 'devtools' package: | ||
|
||
```{r} | ||
devtools::install_github(repo = "TheoreticalEcology/EcoPhyloSim", subdir = "phylosim", | ||
dependencies = T, build_vignettes = T) | ||
?PhyloSim | ||
browseVignettes("PhyloSim") | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: "EcoPhyloSim" | ||
author: "Florian Hartig" | ||
date: "2024-07-19" | ||
output: | ||
html_document: | ||
keep_md: yes | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
``` | ||
|
||
|
||
A model, provided as an R package, for the simulation of spatially explicit biogeographical and phylogenetic data. | ||
|
||
### Installation | ||
|
||
You can install directly from gh, using the 'devtools' package: | ||
|
||
```{r, eval = F} | ||
devtools::install_github(repo = "TheoreticalEcology/EcoPhyloSim/", | ||
subdir = "phylosim", | ||
dependencies = T, | ||
build_vignettes = T) | ||
?PhyloSim | ||
browseVignettes("PhyloSim") | ||
``` | ||
|
||
### | ||
|
||
|
||
```{r} | ||
library(PhyloSim) | ||
# Define a parameter set | ||
par <- createCompletePar(x = 50, y = 50, dispersal = 1 , runs = 1000, | ||
density = 0) | ||
# Run the model | ||
simu <- runSimulation(par) | ||
plot(simu) | ||
# Look at the phylogeny (requires package 'ape') | ||
require(ape) | ||
# Get the phylogeny of the last run. In this example this is after 1000 runs. | ||
phylogeny <- simu$Output[[2]]$phylogeny | ||
# Only extant taxa | ||
extantPhylogeny <- drop.fossil(phylogeny) | ||
# Display the results | ||
plot(extantPhylogeny) | ||
#Look at the species area relation | ||
sac(simu, area = c(1,10,100,1000), rep = 100, plot= TRUE) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters