I try to install whatever package as follows in R (regardless if it is R 4.0 or R 4.2):
install.packages("brms")
and this
install.packages("brms", lib = "path/win-library")
I get this:
* installing *source* package 'brms' ...
** package 'brms' successfully unpacked and MD5 sums checked
** using staged installation
** R
Warning: namespace 'brms' is not available and has been replaced
by .GlobalEnv when processing object 'brmsfit_example1'
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'shiny'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'brms'
* removing 'C:/Users/Documents/R/win-library/4.0/brms'
Warning in install.packages :
installation of package ‘brms’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\AppData\Local\Temp\Rtmp0IDKze\downloaded_packages’
But, when I then want to load it into R it does not exist and I get an error:
library(brms)
Error in library(brms) : there is no package called ‘brms’
I do not even see the folders containing brms
in either of the .libPaths()
. I have tried to unzip the downloaded folder brms
in the temporary folder to the libPaths
, but that does not work either.
I have searched the internet but have not found a proper solution. What should I do to change it? All my packages do not work.