openpharma / openpharma/DoseFinding
plot.DRMod fails when dose or resp arguments for fitMod are supplied as expression
Open
@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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.