Skip to content

Commit b7b9b37

Browse files
committed
Merge branch 'master' of github.com:revbayes/Revticulate
2 parents efcc8c7 + 55f96ca commit b7b9b37

31 files changed

+558
-102
lines changed

DESCRIPTION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Imports:
2020
knitr,
2121
utils,
2222
comprehenr,
23+
knitr,
24+
utils,
2325
jsonlite,
2426
usethis,
2527
rstudioapi

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
# Installation
66

7-
Revticulate can be installed in two ways.
7+
Revticulate can be installed in two ways.
88
The first is via CRAN, using the default `install.packages` function in R:
99

1010
```{r}
1111
install.packages("Revticulate")
1212
```
1313

14-
The second is via the remotes package, a lightweight package enabling installation from GitHub repositories.
14+
The second is via the remotes package, a lightweight package enabling installation from GitHub repositories.
1515

1616
```{r}
1717
remotes::install_github("revbayes/Revticulate")
@@ -31,7 +31,7 @@ knitRev()
3131

3232
## Using RevBayes in a KnitR Chunk
3333

34-
RevBayes can be used in a KnitR chunk by changing the header to `rb` instead of `r`. In the below chunk, we create an object called `example` and use the assignment operator to give it the value 1. Then we print it.
34+
RevBayes can be used in a KnitR chunk by changing the header to `rb` instead of `r`. In the below chunk, we create an object called `example` and use the assignment operator to give it the value 1. Then we print it.
3535
```
3636
example <- 1.0
3737
example
@@ -43,7 +43,7 @@ This is not an overtly useful thing to do, however. Let's erase the previous chu
4343
clearRev()
4444
```
4545

46-
We could, instead, choose to do something a little more useful. How about reading in a data matrix and making a quick starting tree?
46+
We could, instead, choose to do something a little more useful. How about reading in a data matrix and making a quick starting tree?
4747

4848
```
4949
morpho <- readDiscreteCharacterData("bears.nex")
@@ -54,7 +54,7 @@ br_len_lambda ~ dnExp(0.2)
5454
phylogeny ~ dnUniformTopologyBranchLength(taxa, branchLengthDistribution=dnExponential(br_len_lambda))
5555
phylogeny
5656
```
57-
Anything entered in an `rb` block will be interpreted as Rev code, and all the normal Rev syntax will apply. For a nice overview of Rev language and syntax, please see [this tutorial](https://revbayes.github.io/tutorials/intro/rev).
57+
Anything entered in an `rb` block will be interpreted as Rev code, and all the normal Rev syntax will apply. For a nice overview of Rev language and syntax, please see [this tutorial](https://revbayes.github.io/tutorials/intro/rev).
5858

5959
One thing researchers are often interested in doing is making an object in Rev and then viewing it in R. The best way to accomplish this is with the `doRev()` function. When using this function, the RevCode you'd like to run goes in the parentheses of the `doRev` function. These are then exportable to R. In this example, we load the dataset used in the published tutorial "Estimating a time-calibrated phylogeny of fossil and extant taxa using RevBayes" {@barido2020estimating}.
6060
```
@@ -67,7 +67,7 @@ phylogeny ~ dnUniformTopologyBranchLength(taxa, branchLengthDistribution=dnExpon
6767
phylogeny')
6868
```
6969

70-
The `doRev` function is then used to extract the object. Note that knitr chunks can only have one language type. Thus, to use a Rev Object in another chunk, it must be exported. In this case, a phylogeny is not a simple numeric type, and Revticualte automates the coercion from a string to a Newick tree that can be read by Phytools or similar.
70+
The `doRev` function is then used to extract the object. Note that knitr chunks can only have one language type. Thus, to use a Rev Object in another chunk, it must be exported. In this case, a phylogeny is not a simple numeric type, and Revticualte automates the coercion from a string to a Newick tree that can be read by Phytools or similar.
7171

7272
```
7373
phylogeny <- doRev("phylogeny")
@@ -76,7 +76,7 @@ phytools::plotTree(phylogeny)
7676
```
7777

7878

79-
We may choose to clear RevBayes objects out of memory so that they are not being consistently echoed to the screen.
79+
We may choose to clear RevBayes objects out of memory so that they are not being consistently echoed to the screen.
8080

8181
```
8282
@@ -93,7 +93,7 @@ rates_morpho := fnDiscretizeGamma( alpha_morpho, alpha_morpho, 4 )
9393
alpha_morpho
9494
```
9595

96-
If you aren't a big stats person, this might not mean much to you, in terms of what this distribution actually looks like. But it is important to develop intuitions for what common distributions look like and what this says about our data. So, we can use R's built-in graphics capabilities to have a look at what 1000 draws from this gamma will look like.
96+
If you aren't a big stats person, this might not mean much to you, in terms of what this distribution actually looks like. But it is important to develop intuitions for what common distributions look like and what this says about our data. So, we can use R's built-in graphics capabilities to have a look at what 1000 draws from this gamma will look like.
9797

9898
```
9999
doRev('alpha_morpho ~ dnUniform( 0, 1E6 );
@@ -175,7 +175,7 @@ The function `repRev()` can be called in the console (or in non-RStudio versions
175175

176176
## Running Long Computations
177177

178-
Perhaps we would like to run a longer computation from R using Revticulate. For example, maybe we have made an MCMC script, and would like to run it using Revticulate, and then automatically process the output in R. In the below example, we will run an MCMC and automatically evaluate it for convergence using the package conveience.
178+
Perhaps we would like to run a longer computation from R using Revticulate. For example, maybe we have made an MCMC script, and would like to run it using Revticulate, and then automatically process the output in R. In the below example, we will run an MCMC and automatically evaluate it for convergence using the package conveience.
179179

180180
Included with the package, we have a script called 'mcmc_mk.Rev,' which runs a short phylogenetic estimation for a small morphological dataset from bears using the Mk model {@Lewis2001}. Once the computation is complete, convergence is diagnosed with the R package convenience {@fabreti2021}. Please note that this will take about 5 minutes if executed.
181181

@@ -184,6 +184,3 @@ library(convenience)
184184
callRevFromTerminal("mcmc_mk.Rev")
185185
checkConvergence(path = "vignettes/output/")
186186
```
187-
188-
189-

docs/404.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE-text.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)