The RTMB package provides a native R interface for a substantial subset of TMB so you can avoid coding in C++.
RTMB only affects the TMB function MakeADFun that builds the objective function. Once MakeADFun has been invoked, everything else is exactly the same and models run as fast as if coded in C++.
PROS:
More information, including vignettes (introduction / advanced) and documentation, can be found on the RTMB universe page.
install.packages('RTMB')
install.packages('RTMB', repos = c('https://kaskr.r-universe.dev', 'https://cloud.r-project.org'))
NOTE: Requires at least TMB-1.9.7.
remotes::install_github("https://github.com/kaskr/RTMB", subdir="RTMB")
tinytest::test_package("RTMB")
runs the tests.
Rcpp from source and try again (see https://github.com/kaskr/RTMB/issues/5).install.packages('RTMBp', repos = c('https://kaskr.r-universe.dev', 'https://cloud.r-project.org'))
install.packages('RTMBode', repos = c('https://kaskr.r-universe.dev', 'https://cloud.r-project.org'))