From 734ad731a2257d8da3f49f0c28924a809a51c6e2 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 15 Aug 2022 10:42:47 -0500 Subject: [PATCH] Take care of vpcSim objects --- R/vpcPlot.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/vpcPlot.R b/R/vpcPlot.R index 1102833..0fbee6f 100644 --- a/R/vpcPlot.R +++ b/R/vpcPlot.R @@ -72,7 +72,11 @@ vpcPlot <- function(fit, data = NULL, n = 300, bins = "jenks", } } # Simulate with VPC - .sim <- nlmixr2est::vpcSim(fit, ..., keep=stratify, n=n, pred=pred_corr, seed=seed) + if (inheirts(fit, "nlmixr2vpcSim")) { + .sim <- fit + } else { + .sim <- nlmixr2est::vpcSim(fit, ..., keep=stratify, n=n, pred=pred_corr, seed=seed) + } .sim <- nlmixr2est::vpcSimExpand(fit, .sim, stratify) .simCols <- list( id="id",