clusterProfiler cannot load package - bioconductor

I am trying to load clusterProfiler, but regardless of how I install the package or whether I un-install or re-install, I continue to get the below error when I attempt to load it. I have also recently installed and loaded patchwork. Appreciate any tips.
Error: package or namespace load failed for ‘clusterProfiler’:
object ‘patchworkGrob’ is not exported by 'namespace:patchwork'

I had the same issue, and I solved it by loading the library(patchwork) before loading clusterProfiler.
Hope it helps~

Related

Why am I getting this error when loading the redist package in R?

I've recently run into an error that I have not encountered before in RStudio. I'm currently using the newest version of R, 4.1.2. I've installed a package called "redist" and when I load the package in RStudio, I get the following error:
Error: package or namespace load failed for ‘redist’:
.onLoad failed in loadNamespace() for 'units', details:
call: udunits_init(path)
error: no database found!
The following code snippet ist what I used to install and run the package.
install.packages("redist", dependencies = TRUE)
library(installr)
I'm not really sure where to look for this error or how to fix this. Has anyone run into something similiar or does anyone have any advice on what to do?
Messing around with some things, I've come upon a solution that works, even though this may be related to the package itself.
Before loading the redist package, it's necessary to load the udunits2 package. Loading the library then works.

Issue with loading Tidyverse in RStudio

How to do i resolve the following code error?
library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
.onLoad failed in loadNamespace() for 'tidyselect', details:
call: is_string(x)
error: object 'rlang_is_string' not found
In addition: Warning message:
package ‘tidyverse’ was built under R version 3.5.3
For persistent errors of type, first, ensure you are working with the latest version of R. The installr package is a very convenient way to do this.
Then, start new R session (ideally, not in RStudio).
Uninstall tidyverse, tidyselect, and rlang
# if you are using multiple libraries, you may need to specify libpath,
# using the following: lib="~/R/win-library/3.6"
# you can check using the .libPaths() command
remove.packages("rlang")
remove.packages("tidyselect")
remove.packages("tidyverse")
and, reinstall them one by one with dependencies = TRUE
install.packages("rlang", dependencies = TRUE)
install.packages("tidyselect", dependencies = TRUE)
install.packages("tidyverse", dependencies = TRUE)
That should do it.
I also encounter a similar problem like you, which I'm unable to load the tidyverse too.
Hope this discuss from the tidyverse github issues maybe relevant to you.
https://github.com/tidyverse/googledrive/issues/275
Here's one of our typical explanations of this. Note that this is not specific to googledrive or rlang. It's an R + Windows gotcha. I suspect for you is rlang (at least).
Please note that on Windows, it is very important to quit or restart
all R processes before upgrading , because if any R process has
loaded, it will keep the .dll file open and the installer will not be
able to overwrite .dll. The error message when this happens is very
easy to overlook, and the new version will be partially installed: the
package description and R code will be updated but the compiled code
(in .dll) will not.

"object not found" during package build/install

I'm at a loss to debug building/installing a package. Building a package "MyProjekt" through
> devtools::build("MyProjekt")
works fine, even though
> devtools::document()
Updating MyProjekt documentation
Loading MyProjekt
Error: object 'rank' not found whilst loading namespace 'MyProjekt'
fails.
Attempting to install the built (pure R) package
> install.packages(pkgs="./MyProjekt.tar.gz")
...
Error: package or namespace load failed for 'MyProjekt':
object 'rank' not found whilst loading namespace 'MyProjekt'
Error: loading failed
Execution halted
...
ERROR: loading failed for 'i386', 'x64'
also fails.
Unfortunately the term 'rank' is a common term in my domain and I have hundreds of hits when searching in my files for that term.
How might I start a systematic way to hunt this bug down?
The toolchain mistakenly generates S3method(...) in the NAMESPACE file.
Follow this answer and edit the NAMESPACE file by hand. Replace occurrences of S3method(f) with export(f).
I'm not certain this is repeatable. The generated files appear to be not just written, but also read during a subsequent package build (by devtools? by roxygen2?). Add your comments if this works/does not work for you.

R packages not loading via library()

I have been experiencing the problem of not being able to load package libraries in R. The packages install fine via instal.packages(), but I get the error
Error: package or namespace load failed for ‘adegenet’ in library.dynam(lib, package, package.lib):
shared object ‘httpuv.so’ not found
Error: package ‘adegenet’ could not be loaded
When I attempt to load the package 'adegenet' (and any other packages).
I recall this behaviour started to occur when I used remove.packages() to remove shiny in order to install the development version on GitHub (shiny-Incubator).
I am unsure as to what is going on. Any ideas on how to restore everything? I updated to the most recent R version, but this did not fix things.
It seems that during your uninstallation procedure you managed to remove a component of httpuv and/or Rcpp. This should get things working again:
install.packages(c("Rcpp", "httpuv"))

Unable to load recipes package

I install the recipes library just fine using:
install.packages("recipes", dependencies = c("Depends", "Suggests"))
This gives me the following error:
Error in library(recipes) : there is no package called ‘recipes’
I having a bigger issue, I am unable to load caret but it seems the reason I cannot is recipes, so I assume if I solve the recipes issue I will be able to load caret.
This issue is impossible to replicate. You need to answer the following questions:
What is the error message?
What R version are you running?
What is your system?
I tried to install with exactly the same command. Got an error of some missing dependencies, and after running this install.packages(c("caret", "recipes", "klaR", "ipred")) I could finally load "recipes".
os it seems I couldn't install recipes package because of gfortran-4.8 not been available in my system. I followed this and now I can finally load recipes and caret. thank you

Resources