-
Notifications
You must be signed in to change notification settings - Fork 6
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
add option for generating guest function outputs for residualVsObserv… #176
add option for generating guest function outputs for residualVsObserv… #176
Conversation
…ed ddi ratio plot
Codecov Report
@@ Coverage Diff @@
## develop #176 +/- ##
===========================================
- Coverage 48.41% 48.24% -0.18%
===========================================
Files 55 55
Lines 2551 2560 +9
===========================================
Hits 1235 1235
- Misses 1316 1325 +9
Continue to review full report at Codecov.
|
…istency with diagonal case
R/obs-vs-pred-datamapping.R
Outdated
# Apply log10 transformation to lines because | ||
# plot is log scaled in by default and geom_abline | ||
# requires the log transformed values in input of intercept | ||
self$lines <- lapply(lines, log10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does default value in DefaultDataMappingValues
include the log10 ?
If so, line 27 may apply twice the log.
This means that either we need lapply(lines, log10) %||% DefaultDataMappingValues$obsVsPred
with lines = NULL
in input or that DefaultDataMappingValues
account for scale somehow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may want to apply the log10 directly within the plotXX
functions after checking the plotConfiguration
scale is included in Scaling$log
(obs vs pred and res vs pred might be in linear scale).
Otherwise, users can get unwanted log transformation of their diagonal/horizontal lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible could you document the scaling in the @param lines
and maybe in the pk-ratio vignette
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting changes to obs-vs-pred-datamapping.R
and pkratio-datamapping.R
for now.
R/plot-ddiratio.R
Outdated
if(dataMapping$residualsVsObserved){ | ||
lineOrientation <- "horizontal" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a shortcut option for users in the function input as well: e.g. residuals = NULL
?
and internally do something like
validateIsLogical(residuals, nullAllowed = TRUE)
residuals <- residuals %||% dataMapping$residualsVsObserved`
lineOrientation <- "diagonal"
if(residuals){lineOrientation <- "horizontal"}
I think such options are quite convenient for plotTornado
and plotBoxWhisker
and might be valuable for users in plotDDIRatio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use residualsVsObserved
instead of residuals
to keep it consistent with dataMapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but with residualsVsObserved = FALSE
by default and nullAllowed = FALSE
R/obs-vs-pred-datamapping.R
Outdated
# Apply log10 transformation to lines because | ||
# plot is log scaled in by default and geom_abline | ||
# requires the log transformed values in input of intercept | ||
self$lines <- lapply(lines, log10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may want to apply the log10 directly within the plotXX
functions after checking the plotConfiguration
scale is included in Scaling$log
(obs vs pred and res vs pred might be in linear scale).
Otherwise, users can get unwanted log transformation of their diagonal/horizontal lines.
R/obs-vs-pred-datamapping.R
Outdated
# Apply log10 transformation to lines because | ||
# plot is log scaled in by default and geom_abline | ||
# requires the log transformed values in input of intercept | ||
self$lines <- lapply(lines, log10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible could you document the scaling in the @param lines
and maybe in the pk-ratio vignette
At present the DDI plot Guest bounds are for the predictedVsObserved case.
This PR allows for the residualVsObserved case.