Skip to content
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

Model piping with ({}) and strings doesn't quite work #808

Open
mattfidler opened this issue Nov 21, 2024 · 0 comments
Open

Model piping with ({}) and strings doesn't quite work #808

mattfidler opened this issue Nov 21, 2024 · 0 comments

Comments

@mattfidler
Copy link
Member

library(rxode2)
#> rxode2 3.0.2.9000 using 8 threads (see ?getRxThreads)
#>   no cache: create with `rxCreateCache()`
one.cmt <- function() {
  ini({
    ## You may label each parameter with a comment
    tka <- 0.45 # Log Ka
    tcl <- log(c(0, 2.7, 100)) # Log Cl
    ## This works with interactive models
    ## You may also label the preceding line with label("label text")
    tv <- 3.45; label("log V")
    ## the label("Label name") works with all models
    eta.ka ~ 0.6
    eta.cl ~ 0.3
    eta.v ~ 0.1
    add.sd <- 0.7
  })
  model({
    ka <- exp(tka + eta.ka)
    cl <- exp(tcl + eta.cl)
    v <- exp(tv + eta.v)
    linCmt() ~ add(add.sd)
  })
}

scm <- function(ui, par="ka", cov="WT", exp1="exp1", center=70) {
  par1 <- paste0(par, " <- exp(t", par, "+ eta.", par, "+ ", exp1, "*", cov, "/", center,  ")")
  ui %>%
    model({par1})
}
scm(one.cmt)
#> Error in .c[[1]]: object of type 'symbol' is not subsettable

Created on 2024-11-21 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant