From af24cde56a49b532d7f65dd199d176e0ce3cac09 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 14 Sep 2022 22:39:12 +0200 Subject: Remove purrr dependency We now directly import from rlang and vctrs, which were indirect dependencies anyways. purrr::map_dfr is deprecated in the upcoming purrr 1.0, and depends on dplyr (since when?) which is only suggested by purrr. This would lead new installations of mkin to fail if dplyr is not installed as well. --- R/plot.mixed.mmkin.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'R/plot.mixed.mmkin.R') diff --git a/R/plot.mixed.mmkin.R b/R/plot.mixed.mmkin.R index 3a444253..6815bfd2 100644 --- a/R/plot.mixed.mmkin.R +++ b/R/plot.mixed.mmkin.R @@ -153,7 +153,7 @@ plot.mixed.mmkin <- function(x, outtimes <- sort(unique(c(x$data$time, seq(xlim[1], xlim[2], length.out = 50)))) - pred_ds <- purrr::map_dfr(i, function(ds_i) { + pred_list <- lapply(i, function(ds_i) { odeparms_trans <- degparms_all[ds_i, odeparms_names] names(odeparms_trans) <- odeparms_names # needed if only one odeparm if (backtransform) { @@ -171,8 +171,9 @@ plot.mixed.mmkin <- function(x, out <- mkinpredict(x$mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, atol = fit_1$atol, rtol = fit_1$rtol) - return(cbind(as.data.frame(out), ds = ds_names[ds_i])) }) + names(pred_list) <- ds_names[i] + pred_ds <- vctrs::vec_rbind(!!!pred_list, .names_to = "ds") odeparms_pop_trans <- degparms_all_pop[odeparms_names] -- cgit v1.2.1