OHDSI / EmpiricalCalibration

An R package for performing empirical calibration of observational study estimates
http://ohdsi.github.io/EmpiricalCalibration/
10 stars 9 forks source link

plotCalibrationEffect hides extreme values #6

Closed azimov closed 2 years ago

azimov commented 2 years ago

PR incoming

Bug description

When using plotCalibrationEffect with values far to the left or right they are hidden from display.

Steps to reproduce

Produce a plot with crazy values, e.g.

inputDf <- data.frame(logRr = c( 1.1, 1.3, 1, 2, 1.1, 1.3, 1, 2, 1.1, 1.3, 1, 2), seLogRr = c(0.1, 0.5, 0.3))
EmpiricalCalibration::plotCalibrationEffect(inputDf$logRr, inputDf$seLogRr, logRrPositives = c(-3,-2), seLogRrPositives = c(0.1, 1.2))

Warning: Removed 2 rows containing missing values (geom_point).

Proposed solution

Allow x axis limits to be flexible, instead of being fixed at ~0.25 - 10.