Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upggplot.resamples and plot.resamples when results constant #1007
Comments
|
So maybe return out <- c(LowerLimit = NA_real_, UpperLimit = NA_real_, Estimate = mean(x$value, na.rm = TRUE))instead? |
|
Tested, Thanks :) |
|
Do you have a test case that I can use for a unit test? |
|
uhm,
|
|
Give those changes a try. It works for the example that I cooked up. |
Using the function plot or ggplot for an object of class resamples will not visualize data points for a model in which data$model$values are constant or near constant.
The problem seems to be in these lines of code of the ggplot.resamples function (line 982):
In particular the t.test function will fail to report confidence intervals or means. An example:
and thus also the mean alone will not be plotted and the out will be vector of NA.
I suppose that a model with results nearly constant is a rare occurrence, but I realized this because it happened to me. :)
Claudio