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,