Skip to content

Commit 590928f

Browse files
authored
Account for partial matching of predictor variables (#41)
1 parent f5f2388 commit 590928f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/helper_funs.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ gam_to_df <- function(model = NULL, pred = NULL) {
7474
plot_df <- no_plot(model) # nolint
7575

7676
# get list index of spec. predictor
77-
set_pred <- which(grepl(pred, plot_df))
77+
set_pred <- grep(paste0("\\b", pred, "\\b"), plot_df)
7878

7979
df <- data.frame(
8080
x = plot_df[[set_pred]]$x,

0 commit comments

Comments
 (0)