Skip to content

Commit 7f4a400

Browse files
gregorgorjancbenjeffery
authored andcommitted
Added note on slendr in R tut
1 parent 9915dfb commit 7f4a400

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tskitr.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ kernelspec:
2121

2222
To interface with `tskit` in R, we can use the [reticulate](https://rstudio.github.io/reticulate) R package, which lets you call `tskit`'s Python API within an R session. In this tutorial, we'll go through a couple of examples to show you how to get started. You'll need to install `reticulate` in your R session via `install.packages("reticulate")` and at a minimum state the required Python packages via `reticulate::py_require(c("tskit", "msprime"))`. This setting will use `reticulate`'s isolated Python virtual environment, but you can also use an alternative Python environment as described at https://rstudio.github.io/reticulate.
2323

24+
::::{margin}
25+
:::{note}
26+
The [slendr](https://www.slendr.net) R package uses `reticulate` extensively to work with tree sequences in R and also provides R wrappers for some `tskit` functions.
27+
:::
28+
::::
29+
2430
We'll begin by simulating a small tree sequence using `msprime`.
2531

2632
```{code-cell}
@@ -55,7 +61,7 @@ paste(
5561
reduced_ts$num_trees, "trees over", reduced_ts$sequence_length/1e3, "kb.")
5662
```
5763

58-
### IDs and indexes
64+
## IDs and indexes
5965

6066
Note that if a bare digit is provided to one of these methods, it will be treated as a
6167
floating point number (numeric in R). This is useful to know when calling `tskit` methods that

0 commit comments

Comments
 (0)