-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mrgsolve/drake Incompatibility? #471
Comments
Try this: library(mrgsolve)
options(mrgsolve.soloc = "i_love_drake")
mod <- mread_cache("my_model_file.cpp") I don't know how to use drake; but set the option and use If that still doesn't work try adding |
Would it be reasonable to add an attempt to load the shared object, if not already loaded, before throwing the error here: Lines 71 to 76 in ea18191
(And anywhere else that may be an issue) This code appeared to work: library(mrgsolve)
library(drake)
model_text <- "
$PARAM @annotated
CL : 1 : Clearance (volume/time)
V : 20 : Central volume (volume)
KA : 1 : Absorption rate constant (1/time)
$CMT @annotated
EV : Extravascular compartment
CENT : Central compartment
$GLOBAL
#define CP (CENT/V)
$PKMODEL ncmt = 1, depot = TRUE
$CAPTURE @annotated
CP : Plasma concentration (mass/volume)
"
mrgsim_load <- function(x, ...) {
loadso(x)
mrgsim(x, ...)
}
my_plan <-
drake_plan(
model=mcode_cache(model_text, model="pk1"),
my_idata=data.frame(ID=2),
sim_result=mrgsim_load(model, idata=my_idata),
strings_in_dots="literals"
)
make(my_plan)
as.data.frame(readd(sim_result)) |
Also, |
Thanks for the report. I'll open tickets to fix the |
When using drake with mrgsolve, I just got the following error:
Both mrgsolve and drake do magical things with R, and it appears their magic is incompatible in at least this instance.
To reproduce this requires more complexity than a standard reproducible example.
source("run1.txt")
source("run2.txt")
run1.txt
run2.txt
The text was updated successfully, but these errors were encountered: