Open rempsyc opened 1 year ago
This can be reproduced with R version 4.2.2 on Windows locally and on automated tests on GitHub actions machines.
R.Version()$version.string
#> [1] "R version 4.2.2 (2022-10-31 ucrt)"
R.Version()$platform
#> [1] "x86_64-w64-mingw32"
packageVersion("rstanarm")
#> [1] '2.21.3'
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'
Created on 2023-05-07 with reprex v2.0.2
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?