Skip to content

Commit

Permalink
Add lower case fit
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 21, 2022
1 parent c819d63 commit e33a99f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/vpcPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ vpcPlot <- function(fit, data = NULL, n = 300, bins = "jenks",
.sim$idv <- .sim[[idv]]
.obs <- as.data.frame(fit)
.obs$idv <- .obs[[idv]]
.obs$TIME <- .obs[[idv]]
.w <- which(tolower(names(.obs)) == idv)
.obs$TIME <- .obs[, .w]
return(vpc::vpc_cens(sim=.sim,
obs=.obs,
bins=bins, n_bins=n_bins, bin_mid=bin_mid,
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ test_that("test plots with vdiffr", {
apo <- nlmixr2est::augPred(fit)
expect_error(plot(apo), NA)
expect_error(vpcPlot(fit), NA)
expect_error(vpcPlot(fitSim), NA)
expect_error(vpcPlotTad(fit), NA)
expect_error(vpcPlotTad(fitSim), NA)
expect_error(vpcPlot(fit, pred_corr=TRUE), NA)
expect_error(vpcPlot(fitSim, pred_corr=TRUE), NA)
expect_error(vpcPlotTad(fit, pred_corr=TRUE), NA)
expect_error(vpcPlotTad(fitSim, pred_corr=TRUE), NA)
expect_error(vpcCens(fit), NA)
expect_error(vpcCens(fitSim, pred_corr=TRUE), NA)
expect_error(vpcCensTad(fit), NA)
expect_error(vpcCensTad(fitSim, pred_corr=TRUE), NA)

expect_error(plot(fit), NA)

Expand Down

0 comments on commit e33a99f

Please sign in to comment.