-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
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
Conflict with conflicted library, remove uses of apropos()
?
#1141
Comments
Hi, thanks for reporting this. I didn't even know RStan called Lines 77 to 97 in 9b8d8fe
But I'm not sure what it should be changed to. Is there a recommended alternative to |
Hi, perhaps something like The 'real issue' is that because |
Here is a reprex of the problem as it appeared to me. library(conflicted)
library(rstan)
library(dplyr)
scode <- "
parameters {
array[2] real y;
}
model {
y[1] ~ normal(0, 1);
y[2] ~ double_exponential(0, 2);
}
"
fit1 <- stan(model_code = scode, iter = 10, verbose = FALSE)
|
The problem is that because ... After a little more investigation part of the problem, I noticed that is_stan_model <- function(x) {
isS4(obj) && (is(obj, "stanfit") || is(obj, "stanmodel"))
}
find_matching_model <- function(model_code, env) {
model_re <- "(^[[:alnum:]]{2,}.*$)|(^[A-E,G-S,U-Z,a-z].*$)|(^[F,T].+)"
names <- ls(envir = env)
candidate_names <- names[grepl(model_re, names)]
for (name in candidate_names) {
obj <- get(name, envir = env, inherits = FALSE)
if (is_stan_model(obj) && identical(obj@model_code[1], model_code)) {
return(obj)
}
}
NULL
} If you wanted to be extra safe to preserve the existing behaviour, you could call |
Hello,
It appears that Rstan's use of the
apropos()
function is causing conflicts with theconflicted
library, so I was advised to open an issue here to see if all uses ofapropos()
could be removed?It doesn't seem like changing
apropos()
is feasible and it's not clear if it would be a good idea or even possible to change theconflicted
library to make things work. Also,conflicted
seems like a really important package for computational reproducibility and considering R's nature.Please see the attached discussion for further context. Here
Michael
The text was updated successfully, but these errors were encountered: