1 |
... |
|
DLL |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (..., DLL = TMB:::getUserDLL())
{
orig_dir <- getwd()
setwd(tempdir())
on.exit(setwd(orig_dir))
All_inputs <- list(..., DLL = DLL)
save(All_inputs, file = "All_inputs.RData")
DLL <- All_inputs$DLL
DLLfull <- paste0(orig_dir, "/", DLL)
txt <- c("library( TMB )", paste0("dyn.load(dynlib('", DLLfull,
"'))"), "load( 'All_inputs.RData' )", "Obj <- do.call(TMB::MakeADFun, All_inputs)")
writeLines(txt, paste0(DLL, ".R"))
Bdg_output <- gdbsource(paste0(DLL, ".R"))
if (length(grep("#0", Bdg_output)) > 0) {
message("Model has errors")
print(Bdg_output)
stop()
}
TMB::MakeADFun(..., DLL = DLL)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.