List of available functions

The C++ functions bound to R via Rcpp used in outbreaker2 for priors, likelihoods and movements are not visible to the user, as they are not exported by the package. However, advanced users can access these functions using get_cpp_api(), which returns an environment with all relevant functions:

library(outbreaker2) 

## get all functions in an environment
x <- get_cpp_api()
x

## check content
ls(x)

## all functions are Rcpp bindings to a C++ function
x$cpp_ll_all

Function signatures

These functions take the following arguments:

list_args <- lapply(x, args)[ls(x)]
list_args

Arguments are detailed in the next section.

Arguments

Arguments of the Rcpp-bound C++ functions are:

list_formals <- lapply(x, formals)
args <- sort(unique(unlist(lapply(list_formals, names))))
args
temp <- sub("cpp_prior_", "", ls(x, pattern = "cpp_prior.*"))
setdiff(temp, "all") 
temp <- sub("cpp_ll_", "", ls(x, pattern = "cpp_ll.*"))
setdiff(temp, c("timing", "all"))       


reconhub/outbreaker2 documentation built on July 5, 2022, 12:25 p.m.