-
Notifications
You must be signed in to change notification settings - Fork 13
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
plotIndividualTimeProfile(): error when DataCombined
is emtpy
#1010
Comments
DataCombined
is emtpyDataCombined
is emtpy
But this is not something tlf can do. It doesn't return an empty plot; it returns tlf::plotTimeProfile(
data = data.frame(),
observedDataMapping = tlf::ObservedDataMapping$new(
x = "xValues",
y = "yValues",
group = "group",
error = "yErrorValues"
),
plotConfiguration = tlf::TimeProfilePlotConfiguration$new()
)
#> Warning in tlf::plotTimeProfile(data = data.frame(), observedDataMapping =
#> tlf::ObservedDataMapping$new(x = "xValues", : 'data' and 'observedData' are of
#> length 0. Time profile layer was not added.
#> NULL Created on 2022-07-04 by the reprex package (v2.0.1.9000) Also, I am not sure if it makes sense to plot anything in such cases. library(ggplot2)
ggplot() Created on 2022-07-04 by the reprex package (v2.0.1.9000) |
I think this is the best solution because we are also being consistent with the underlying tlf function: library(ospsuite)
myCombDat <- DataCombined$new()
plotIndividualTimeProfile(myCombDat)
#> Warning in .plotTimeProfile(dataCombined, defaultPlotConfiguration): No plot
#> can be created because the entered `DataCombined` object does not contain any
#> datasets.
#> NULL Created on 2022-07-04 by the reprex package (v2.0.1.9000) |
That sounds reasonable. |
* initialize `plotObservedVsSimulated()` * naming * preliminary test * show message only once across groups * interpolation in edge case * DRY in setting same properties across plots * also test custom plot * for now, only one line * also test smoother * update snapshots * fix tests * fix tests * Use `foldDistance` arg from tlf * Need the latest version * fix documentation issue This issue was introduced in #995 * introduce tolerance * Use unit-dependent thresholds * linear smoother by default * add example to aggregated data function * Update DefaultPlotConfiguration.Rd * correct fold distance * deal with linear scale * update snapshot * set smoother to NULL * use long dash * use expand * add expand option * better * use messages instead * minor * catch with tlf * update snapshots * pass args to legend config * update other plots as well * legend key text should be left-aligned * address code review comments * test adding more fold distances work * Return `NULL` when `DataCombined` is empty Closes #1010 Closes #1011 * Handle edge case in paired plot Closes #1012 * remove `smoother` arg * update snapshots * fix legend alignment issue * legendCaption -> legendKeys * catch up with tlf * also include residual values * add error bars to the plot * comments
Instead, it should produce an empty plot (and, if defined in the plot configuration, title subtitle and so on).
The text was updated successfully, but these errors were encountered: