You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stan_lmer cannot be used through namespacing (rstanarm::stan_lmer), which creates issues in packages depending on rstanarm.
Description:
stan_lmer cannot be used through namespacing (rstanarm::stan_lmer), because it generates an error, could not find function "stan_glmer". This creates issues in packages depending on rstanarm, such as the report package.
A workaround that we have been using is super-assignment, of the following type:
stan_glmer<<-rstanarm::stan_glmer
However, for mysterious reasons, during our automated tests, even though we never explicitly load the rstanarm library, sometimes it will load itself. Once loaded, it will not allow super-assignment to overwrite its function name, with error cannot change value of locked binding for 'stan_glmer'. This can be reproduced with the steps below:
Reproducible Steps:
R.Version()$version.string#> [1] "R version 4.3.0 (2023-04-21 ucrt)"
R.Version()$platform#> [1] "x86_64-w64-mingw32"
packageVersion("rstanarm")
#> [1] '2.21.4'x<-rstanarm::stan_lmer(Sepal.Length~Petal.Length+ (1|Species),
data=iris, refresh=0, iter=1000, seed=333)
#> Error in stan_glmer(formula = Sepal.Length ~ Petal.Length + (1 | Species), : could not find function "stan_glmer"
suppressPackageStartupMessages(library(rstanarm))
stan_glmer<<-rstanarm::stan_glmer#> Error in eval(expr, envir, enclos): cannot change value of locked binding for 'stan_glmer'
Summary:
stan_lmer
cannot be used through namespacing (rstanarm::stan_lmer
), which creates issues in packages depending onrstanarm
.Description:
stan_lmer
cannot be used through namespacing (rstanarm::stan_lmer
), because it generates an error,could not find function "stan_glmer"
. This creates issues in packages depending onrstanarm
, such as thereport
package.A workaround that we have been using is super-assignment, of the following type:
However, for mysterious reasons, during our automated tests, even though we never explicitly load the
rstanarm
library, sometimes it will load itself. Once loaded, it will not allow super-assignment to overwrite its function name, with errorcannot change value of locked binding for 'stan_glmer'
. This can be reproduced with the steps below:Reproducible Steps:
Created on 2023-05-07 with reprex v2.0.2
Question
Is there any official workaround for this issue?
The text was updated successfully, but these errors were encountered: