Hi,
I usually have got about 150 packages loaded.
I have used this:
library(nothing, quietly = TRUE)
and then I have only utils and base loaded. This is very good. When I want to load tidyverse or other needed packages I get an error:
Loading the required package: Rcpp
Error: loading package or namespace failed for 'Rcpp' in .Call(C_R_getClassFromCache, name, .classTable):
NULL value passed as symbol address
ERROR: package 'Rcpp' could not be loaded
ERROR: loading package or namespace failed for 'tidyverse':
.onAttach failed in 'attachNamespace()' function for 'tidyverse' package, details:
call: NULL
error: loading package or namespace failed for 'ggplot2' in .Call(C_R_getClassFromCache, name, .classTable):
NULL value passed as symbol address
I want to do this because when I use :
m <- brms::brm(NumericLikert ~ 1, data=data1, family=cumulative(link='probit'), cores=4)
and all packages are loaded it stops constantly and asks me about conflicts preferences. This is annoying.
So I thought that unloading all packages and load only a few would be a solution, but it is not.
Any help will be much appreciated.
1st to say is that r library(name of package) will load one library at a time.
2nd to say is that ggplot2 and tidyverse are very useful packages and you should try to uninstall packages and reinstall them. to uninstall a package use the function r remove.packages(“package name”)
why / how ?
When I start a new session I have 0 packages loaded
for a given project; the packages needed for that project are loaded by the use of a script that lists them out.
I wonder if you are not using project(s) ? and you potentially save/load a single workspace to do all manner of work ? I advise against such an approach.
I wouldnt rely on that functionality.
My advice is to find alternative solutions that dont involve attempting to 'unload' libraries; R doesnt seem to have been designed with this in mind; so you will get frustrated at every turn.
You could look at package conflicted to explicitly deal with potential conflicts in your projects in an upfront manner.
if brms::brm is simply wildly misbehaving then I would raise an issue with its developers.
Perhaps the solution is to load your environment cleanly when you start. If you have the following option not selected as in the image below (from Tools.. Global Options.. in RStudio: