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

Crash of dv.preds.vs.idv when WRES missing #10

Open
rikardn opened this issue Apr 9, 2019 · 3 comments
Open

Crash of dv.preds.vs.idv when WRES missing #10

rikardn opened this issue Apr 9, 2019 · 3 comments
Assignees

Comments

@rikardn
Copy link
Member

rikardn commented Apr 9, 2019

I run a simple model (pheno) with the following table:

$TABLE ID MDV TIME DV IPRED PRED RES CWRES NOAPPEND NOPRINT ONEHEADER FILE=sdtab1

Loading into an xpose4 database and doing xpose4::dv.preds.vs.idv(xpdb) caused xpose4 to crash with the following backtrace:

Error in limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, : need at least one panel
7.stop("need at least one panel")
6.limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, ...
5.xyplot.formula(formula(formel), data, obj = object, prepanel = function(x, y) { xlim <- NULL ylim <- NULL ...
4.xyplot(formula(formel), data, obj = object, prepanel = function(x, y) { xlim <- NULL ylim <- NULL ...
3.xpose.plot.default(xvardef("idv", object), c(xvardef("dv", object), xvardef("ipred", object), xvardef("pred", object)), object, scales = scales, ylb = ylb, layout = layout, smooth = smooth, ...)
2.xpose4::dv.preds.vs.idv(xpdb)
1.print(xpose4::dv.preds.vs.idv(xpdb))

Adding the column WRES to the $TABLE stops it from crashing.

@andrewhooker
Copy link
Collaborator

By default xpose4 expects the 'standard' parameters to be found in NONMEM table output. This includes IWRE, IPRE, TIME, and the NONMEM default items (DV, PRED, RES and WRES) that are added when NOAPPEND is not present in the $TABLE record. If you remove NOAPPEND then your example should work.

WRES is used to filter non-observation rows from NONMEM table files. I suppose that CWRES, if present, could be used instead of WRES in future releases. But currently this is not the case.

@andrewhooker andrewhooker self-assigned this Apr 9, 2019
@rikardn
Copy link
Member Author

rikardn commented Apr 9, 2019

(I guess MDV could be used as well.)

It would be of great help if xpose could give an error message here pointing the user to what is missing.

@andrewhooker
Copy link
Collaborator

Yes. Agree. I think there is some good logic in xpose that we can use here (check for EVID as well).

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

2 participants