openpharma / openpharma/DoseFinding

plot.DRMod fails when dose or resp arguments for fitMod are supplied as expression

Open
#51 0 comments 0 reactions 1 assignee View on GitHub

@MThomas91 is already working on this.

Since Aug 20, 2026.

bug
Dominant language
R
Stars
14
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Modified fitMod example where dose is supplied as expression (instead of supplying variable) and plotting fails:

data(IBScovars)
anovaMod <- lm(resp~factor(dose)+gender, data=IBScovars)
drFit <- coef(anovaMod)[2:5] # placebo adjusted estimates at doses
vCov <- vcov(anovaMod)[2:5,2:5]
## instead of creating new dose variable directly use expression in fitMod
#dose <- sort(unique(IBScovars$dose))[-1]
gfit2 <- fitMod(sort(unique(IBScovars$dose))[-1], drFit, S=vCov, model = "emax", type = "general",
               placAdj = TRUE, bnds = c(0.01, 2))
plot(gfit2, CI=TRUE, plotData = "meansCI")  ## fails

This is likely an issue with plotFunc which tries to build a formula based on the original expression which fails (or can have unintended consequences) for expressions such as the one above

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.