Skip to content

Commit 911f82b

Browse files
committed
End of day
1 parent 1f15a9c commit 911f82b

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

RcppTskit/vignettes/RcppTskit_intro.qmd

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -286,24 +286,23 @@ ts$num_individuals()
286286
### 4) Call `tskit` C API in C++ code in another R package
287287

288288
To call the `tskit` C API in your own R package via `Rcpp` you can leverage `RcppTskit`.
289-
Just follow the steps below.
290-
To see details of each step, see the files in the R package `AlphaSimR`
291-
at this commit (proof of concept of using `tskit` C API via `tskitr`[^1]):
292-
https://github.com/HighlanderLab/AlphaSimR/commit/12657b08e7054d88bc214413d13f36c7cde60d95
293-
(with time this implementation might require changes).
289+
Just follow the steps below and check how these were implemented in
290+
the test R package `RcppTskitTestPkgLinkingTo` at TODO.
294291

295-
[^1]: At that time we named the package as `tskitr`.
296-
Simply replace `tskitr` with `RcppTskit`,
297-
respecting the lower and upper case depending on the file.
292+
a) Open `DESCRIPTION` file and add `RcppTskit` to the `LinkingTo:` field,
293+
TODO: likely also `Imports:` field.
298294

299-
a) Open `DESCRIPTION` file and add `RcppTskit` to the `LinkingTo:` field.
295+
TODO: And Rcpp too?
300296

301297
b) Add `#include <tskit.h>` as needed to your C++ header files in `src` directory.
302298

303-
c) Call `tskit` C API as needed in your C++ code in `src` directory
304-
(see examples in `RcppTskit`).
299+
c) Add `// [[Rcpp::depends(RcppTskit)]]` to your C++ files in `src` directory.
305300

306-
d) Configure your package build to use the `RcppTskit` library file
301+
d) Add `// [[Rcpp::plugins(RcppTskit)]]` to your C++ files in `src` directory.
302+
303+
e) Call `tskit` C API as needed in your C++ code in `src` directory.
304+
305+
f) Configure your package build to use the `RcppTskit` library file
307306
with the following steps:
308307

309308
- Add `src/Makevars.in` and `src/Makevars.win.in` files with
@@ -320,7 +319,7 @@ d) Configure your package build to use the `RcppTskit` library file
320319
- Add `cleanup` and `cleanup.win` scripts (and make them executable)
321320
to remove `src/Makevars` and `src/Makevars.win` as well as compilation files.
322321

323-
e) You should now be ready to build, check, and install your package using
322+
g) You should now be ready to build, check, and install your package using
324323
`devtools::build()`, `devtools::check()`, and `devtools::install()`
325324
or their `R CMD` equivalents.
326325

0 commit comments

Comments
 (0)