File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ Authors@R:
66Description: This is a stub package that shows how to link to and import
77 from RcppTskit package, which provides R access to tskit C API.
88License: MIT + file LICENSE
9- Imports:
10- RcppTskit
119LinkingTo:
1210 RcppTskit
1311Remotes:
Original file line number Diff line number Diff line change 1+ library(usethis )
2+ path <- " ."
3+ create_package(path )
4+ proj_activate(path )
5+ use_mit_license(" Gregor Gorjanc" )
6+
7+ # Add to DESCRIPTION next two lines:
8+ # Imports: RcppTskit
9+ # LinkingTo: RcppTskit
10+ # And until RcppTskit is on CRAN, add to DESCRIPTION also this line:
11+ # Remotes: git::git@bitbucket.org:HighlanderLab/RcppTskit.git
12+
13+ use_tidy_description()
14+
15+ use_readme_md()
16+
17+ use_test(" my-test" )
18+
19+ use_git()
20+
21+
22+ Imports : Rcpp , RcppTskit
23+ LinkingTo : Rcpp , RcppTskit
Original file line number Diff line number Diff line change 1+ PKG_LIB = @RCPPTSKIT_LIB@
Original file line number Diff line number Diff line change 1+ #include < tskit.h>
2+ // [[Rcpp::depends(RcppTskit)]]
3+ // [[Rcpp::plugins(RcppTskit)]]
4+
5+ // ' @title Get number of individuals in tree sequence
6+ // ' @param ts an external pointer to a \code{tsk_treeseq_t} object.
7+ // ' @return integer number of individuals.
8+ // ' @examples
9+ // ' ts_file <- system.file("examples", "test.trees", package = "RcppTskit")
10+ // ' ts <- RcppTskit::ts_load(ts_file)
11+ // ' RcppTskit::ts$num_individuals()
12+ // ' ts_num_individuals_ptr2(ts$pointer)
13+ // ' @export
14+ // [[Rcpp::export]]
15+ int ts_num_individuals_ptr2 (const SEXP ts) {
16+ RcppTskit_treeseq_xptr ts_xptr (ts);
17+ return static_cast <int >(tsk_treeseq_get_num_individuals (ts_xptr));
18+ }
You can’t perform that action at this time.
0 commit comments