We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I()
During an L1 search, I() terms may cause an error:
N <- 41L K <- 5L K_fac <- 4L set.seed(457324) dat <- data.frame( y = rnorm(N), xcat = gl(n = K, k = floor(N / K), length = N, labels = paste0("gr", seq_len(K))), xfac = sample(gl(n = K_fac, k = floor(N / K_fac), length = N, labels = paste0("fgr", seq_len(K_fac)))), xlog = sample(rep_len(c(TRUE, FALSE), length.out = N)) ) levels(dat$xfac) <- c(levels(dat$xfac), paste0("fgr", (K_fac + 1L):(K_fac + 2L))) dat$xcat <- as.character(dat$xcat) library(rstanarm) rfit <- stan_glm(y ~ xcat + xfac + I(!xlog), data = dat, seed = 1140350788, chains = 1, iter = 500, refresh = 0) library(projpred) # debug(projpred:::search_L1) # debug(projpred:::collapse_contrasts_solution_path) cvvs <- cv_varsel(rfit, ### The issue does not occur with forward search: # method = "forward", ### nclusters = 1, nclusters_pred = 1, seed = 46782345)
giving
Error in str2lang(x) : <text>:1:20: unexpected numeric constant 1: . ~ xfac + I(!xlog)TRUE ^
The issue seems to be that collapse_contrasts_solution_path() does not escape all special symbols for regular expressions (only +):
collapse_contrasts_solution_path()
+
projpred/R/formula.R
Lines 757 to 783 in a6ee4f9
The text was updated successfully, but these errors were encountered:
Fix stan-dev#404: In collapse_contrasts_solution_path(), use `esc_c…
accaf22
…hars()` for escaping all possible regexp-special characters.
Test issue stan-dev#404.
1b607da
Tests: Now that issue stan-dev#404 is tested: Fix the expectations
68d5e6d
(and, more generally, the tests).
Merge pull request #408 from fweber144/fix404
9850dca
Fix #404
Successfully merging a pull request may close this issue.
During an L1 search,
I()
terms may cause an error:giving
The issue seems to be that
collapse_contrasts_solution_path()
does not escape all special symbols for regular expressions (only+
):projpred/R/formula.R
Lines 757 to 783 in a6ee4f9
The text was updated successfully, but these errors were encountered: