m-clark / mixedup

An R package for extracting results from mixed models that are easy to use and viable for presentation.
http://m-clark.github.io/mixedup
MIT License
64 stars 2 forks source link

Installation false warning #10

Closed m-clark closed 2 years ago

m-clark commented 4 years ago

In a recent fresh install I can get the following on a machine that does not have all the packages that might be used.

Error : (converted from warning) namespace ‘rstanarm’ is not available and has been replaced by .GlobalEnv when processing object ‘brms_model’ ERROR: unable to build sysdata DB for package ‘mixedup’

There is no issue with the build or hundreds of tests, and I have not otherwise found any error. brms_model (along with rstanarm_model) is an internal data object used for the vignettes so that it doesn't have to compile/run during their build. I found that deleting rstanarm or lme4 packages causes this error, but not having other packages installed (like glmmTMB) is not a problem.

There is a closed issue on devtools/remotes that speaks to the problem, but actually wasn't resolved: https://github.com/r-lib/remotes/issues/374

I will update the ReadMe with the workaround noted in the remotes issue and post it here, but otherwise have no idea why it's a problem with 4.0, as nothing changed on my end regarding these objects.

Workaround:

withr::with_envvar(c(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true"), 
  devtools::install_github('m-clark/mixedup')
)
m-clark commented 4 years ago

Possibly an rstantools issue.

m-clark commented 3 years ago

At present this no longer fails with 4.1.1 (at least on Mac), but will still warn during build as it did before (example where brms is installed but rstanarm is not). Perhaps during next update it'd be good to retest. I don't really care about the warning but will leave this open for a while longer.

Warning: namespace ‘rstanarm’ is not available and has been replaced
by .GlobalEnv when processing object ‘brms_model’