Skip to content

Commit

Permalink
feat: pass main argument to .plot.cal
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Jun 15, 2022
1 parent e7b4780 commit e319a0d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ameld
Title: Data and Model of End-Stage Liver Disease used in the AMPEL Project
Version: 0.0.23
Version: 0.0.24
Description:
A dataset of patients evaluated for liver transplantation at the
University Hospital Leipzig from November 2012 to June 2015.
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Changes in development

## Changes in 0.0.24

- Pass `main` argument to `.plot.cal`, affected function: `plot.boot.glmnet`.

## Changes in 0.0.23

- Add `"times"` argument to `basehaz`.
Expand Down
4 changes: 2 additions & 2 deletions R/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ plot.boot.glmnet <- function(x, col = head(viridisLite::viridis(3L), 2L),
.plot.sel.var(x, col = col, pch = pch, ...)
}

.plot.cal <- function(x, col, pch, legend = TRUE, ...) {
.plot.cal <- function(x, col, pch, legend = TRUE, main = NULL, ...) {
plot(NA, xlim = c(0L, 1L), ylim = c(0L, 1L), axes = FALSE, ann = FALSE)
title(main = "90 Day Survival", adj = 0L)
title(main = main, adj = 0L)
title(ylab = "Observed", adj = 1L)
title(xlab = "Predicted", adj = 1L)
abline(0L, 1L, col = "#808080", lty = 2L, lwd = 1L)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/bootstrap/boot-glmnet-plot-cal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion tests/testthat/test_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ test_that("bootstrap", {
#' # use `testthat::snapshot_review()` to add new/verify changed plots
#' testthat::snapshot_review()
vdiffr::expect_doppelganger(
"boot.glmnet-plot-cal", function()plot(b, what = "calibration")
"boot.glmnet-plot-cal",
function()plot(b, what = "calibration", main = "Title")
)
vdiffr::expect_doppelganger(
"boot.glmnet-plot-sel", function()plot(b, what = "selected")
Expand Down

0 comments on commit e319a0d

Please sign in to comment.