Description Usage Arguments Details Examples
Run bamm through R.
1 | bamm(control_file, indir, outdir = indir)
|
control_file |
File path to control file |
indir |
File path to directory containting all input files specified in the control file. |
outdir |
File path to directory where all resulting files will be placed. |
control_file
is equivalent to the -c
option in the
command line version of the program. By default, the command-line version
looks in the folder where it was launched to find files specified in the
control file (e.g. tree file). In this version, the indir
determines
where input files are contained.
For efficiency, it is based to specify an indir
folder that contains
only the files required to run the BAMM analysis.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(outsider)
bamm <- module_import('bamm', repo = 'dombennett/om..bamm')
# create temp directory to contain test input and output data
wd <- file.path(tempdir(), 'testing_bamm')
if(!dir.exists(wd)) {
dir.create(wd)
}
# download modified template control file for a "speciation-extinction"
# analysis of whales
url <- 'https://raw.githubusercontent.com/DomBennett/om..bamm/master/test_data/whale_diversification.txt'
control_file <- file.path(wd, 'whale_diversification.txt')
download.file(url = url, destfile = control_file)
# download a tree whales
url <- 'https://raw.githubusercontent.com/DomBennett/om..bamm/master/test_data/whaletree.tre'
download.file(url = url, destfile = file.path(wd, 'whaletree.tre'))
# run bamm in R by specifying the control file and the directory containing the
# whale tree
bamm(control_file = control_file, indir = wd, outdir = wd)
# clean up
unlink(x = wd, recursive = TRUE, force = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.