From 590928fbc572aa2ca9f7092d69bdf46b9b8a17a0 Mon Sep 17 00:00:00 2001 From: Patrick Schratz Date: Sun, 24 May 2020 23:32:31 +0200 Subject: [PATCH] Account for partial matching of predictor variables (#41) --- R/helper_funs.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/helper_funs.R b/R/helper_funs.R index 718c3fa..c7d908c 100644 --- a/R/helper_funs.R +++ b/R/helper_funs.R @@ -74,7 +74,7 @@ gam_to_df <- function(model = NULL, pred = NULL) { plot_df <- no_plot(model) # nolint # get list index of spec. predictor - set_pred <- which(grepl(pred, plot_df)) + set_pred <- grep(paste0("\\b", pred, "\\b"), plot_df) df <- data.frame( x = plot_df[[set_pred]]$x,