build/refresh.R

## message("Update init.c for R based registration of routines.")
## unlink(devtools::package_file("src/init.c"))
## tools::package_native_routine_registration_skeleton(devtools::package_file(""),
##                                                     devtools::package_file("src/init.c"))

## lines <- readLines(devtools::package_file("src/init.c"))
## ## These are the c functions not created in nlmixr
## ## FIXME: why?
## reg <- rex::rex(or("RxODE_mod_m1_ode_solver"))

## lines <- lines[regexpr(reg, lines) == -1]
## writeLines(lines, devtools::package_file("src/init.c"));

cat("Generate nlme_fit_gen.R")
sink(devtools::package_file("R/nlme_fit_gen.R"))
cat("## This file is generated by build/refresh.R\n");
for (f in c("augPred", "predict", "ACF")){
    cat(sprintf("##' @importFrom %s %s\n##' @export \n%s.nlmixr_nlme <- function(object, ...){
  nlmixr::nlmeModList(object$env);
  on.exit({nlmixr::nlmeModList(new.env())})
  tmp <- object;
  class(tmp) <- class(tmp)[-1]
  %s(tmp, ...);
}\n", ifelse(f == "predict", "stats", "nlme"), f, f, f))
}
sink()
cat("\n");
nlmixrdevelopment/nlmixr documentation built on Aug. 22, 2023, 2:16 p.m.