Facing issue with R package Phyloseq - r

Since i have removed phyloseq package from my RStudio. Every time when i am running any code the below lines are coming again and again and halting my codes. This below lines coming again and again in console whenever i am opening the RStudio. Don't know how to deal with this problem. Please help me to solve this problem. I am also attaching a picture which will show my problem properly.
Loading required package: phyloseq
Error in .requirePackage(package) :
unable to find required package ‘phyloseq’
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘phyloseq’
Thanks & Regards
Rishikesh
I haven't tried anything yet to solve this problem. But one person telling me this problem arises due to dependency packages of phyloseq. Please help me to solve this problem.

It is not a package dependency issue, looks like you have somehow added this package as a start-up required to your .Rprofile file.
locate your .Rprofile file (you might have several, the default should be located at your home directory ~/.Rprofile on MacOS/Linux), open it with a text editor and remove the line with phyloseq (could be like library(phyloseq).
If you couldn't find the file or edit it for any reason, the easiest solution could be just reinstalling the package, that would probably do the job for you as well.

Related

Usage of an Internal R Package Error Message

I am trying to use a company internal r-package and I am getting the following warning message in R-Studio when I want to load the library. So installation works, but when I try to load the library is spits this error:
"In fun(libname, pkgname) :"
Does anyone know what the problem is here?
Thanks in advance!
try installing first with install.packages("path to your .zip package file", repos=NULL)
Then use library or require. If anything goes wrong with these two steps, there is a problem with the package itself and you should ask its developers for help.
EDIT: if your package is on github, you can try:
install.packages("devtools")
library("devtools")
devtools::install_github("your package URL")

Error in namespaceExport(ns, exports) when loading dyplyr and tidyverse

I am new to R. I am using version 4.0.2 (windows) and it was working well until I tried to use "dplyr" and "tidyverse" packages. I am able to download both packages but when I try to load them I get the error below. I have tried reinstalling R and Rstudio, I have tried update.packages() and then restarted Rstudio but still I get this error. If I try require(dplyr), then I still this error.
Can anyone please help me?
> library(dplyr) Error: package or namespace load failed for ‘dplyr’ in namespaceExport(ns, exports): undefined exports: as_glue, backtick, double_quote, glue, glue_col, glue_collapse, glue_data, glue_data_col, glue_data_safe, glue_data_sql, glue_safe, glue_sql, identity_transformer, single_quote, trim In addition: Warning message: S3 methods ‘+.glue’, ‘[.glue’, ‘[[.glue’, ‘as.character.glue’, ‘as_glue.character’, ‘as_glue.default’, ‘as_glue.glue’, ‘print.glue’ were declared in NAMESPACE but not found
This became too long for a comment, but it might be because the library dplyr is part of the tidyverse library. tidyverse is much bigger, and includes a bunch of different libraries/packages https://www.tidyverse.org/packages/
Do you still get the error if you load dplyr without tidyverse? In other words does the error only come when you load the second package, regardless of which is the second? It might be telling you that it can't load the package twice, but I am not sure, I haven't seen this specific error message.
I just wanted to share that I managed to fix this problem. I realised that the folder where the packages were being stored was being backed up in OneDrive, ie. OneDrive was in the file pathway. So I unlinked my OneDrive, re-installed R, Rtools & Rstudio and then both dplyer and tidyverse started working for me. I don't know why I didn't have that error with other packages but this seems to have fixed it...
I had the same problem and the issue was, specifically, that the 'digest' package was stored into my OneDrive. The issue was solved (after three days of struggle) when I created a local library (~/local-lib) for the package that required ggplot2 (called, "factoextra").
install.packages("ggplot2", lib = "C:/Users/MY_USER_NAME/R/local-lib")
library("ggplot2",lib = "C:/Users/MY_USER_NAME/R/local-lib")
install.packages("digest", lib = "C:/Users/MY_USER_NAME/R/local-lib")
library("digest",lib = "C:/Users/MY_USER_NAME/R/local-lib")
install.packages("factoextra", lib = "C:/Users/MY_USER_NAME/R/local-lib")
library("factoextra",lib = "C:/Users/MY_USER_NAME/R/local-lib")
Another more permanent solution is published here, but I only have limited administrative rights to my computer, so I couldn't pull this one off. If you are hampered by admin rights, you can potentially run your R environment in Anaconda, which also isn't a perfect solution, but for those of us in universities with stringent IT departments, that seems to work alright.
I had a similar problem with the civis package and determined that installing the roxygen2 package first would allow the civis installation to complete. It still gave a bunch of namespace warnings, and I'm having to call civis functions using the civis:: prefix, but other than that it seems to work.
I doubt this is the only cause of this kind of error, but if you're having problems it might be worth a try!

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.

I have an error message "The system cannot find the path specified" when installing Caret package in R

When I installed CARET package in R, I got following error message.
Error in install.packages : path[1]="D:\Users\hrdchs\Documents\.Rhistory\R-3.6.0\library": The system cannot find the path specified
I tried to find Document.Rhistory, I could not find the folder ".Rhistory" under Documents folder, I could not find any. When I tried to manually create folder with name of ".Rhistory", system does not allow a folder name starting with ".". I guess this may cause the problem.
Can you please help?
Thanks
In addition to doing install.packages("caret"), I tried following:
It really took a long time but still encountered the same problem.
install.packages("caret",
repos = "http://cran.r-project.org",
dependencies = c("Depends", "Imports", "Suggests"))
setwd("D:/Users/hrdchs/Documents/0 SHR/R/Attrition Analysis/IBM attrition data set")
HRdata <- read.csv("IBMhrData.csv")
library(caret)
By the way, I upgraded R from 3.5.1 to version 3.6.0 trying to help to resolve this issue.
I wonder if this issue is caused by this upgrade.

error with R CMD check because of package dependency

Background
I am creating a newpackage that depends on oldpackage, and have indicated this dependency in the file newpackage/DESCRIPTION.
Furthermore,
oldpackage is installed in the directory, ~/lib/R
my .Rprofile includes .libPaths("~/lib/R")
hence, I can successfully load oldpackage without specifying the library location, e.g., using the command library(oldpackage) in R
Despite the ability to load the package without having its library specified, R CMD check newpackage gives an error indicating that it can not fine oldpackage:
checking whether the package can be loaded ... ERROR
Loading required package: oldpackage
Error: package 'oldpackage' could not be loaded
In addition: Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
there is no package called 'oldpackage'
Execution halted
It looks like this package has a loading problem: see the messages for
details.
Questions:
Why is R unable to find the package?
Can I specify the library location in the DESCRIPTION file?
Regarding question 1), it is both a FAQ and yet somewhat annoying. R CMD check runs in vanilla mode, so it will not find user-level libraries. As I recall, setting R_LIBS="...." in the call helps, so try that.
Regarding question 2), no you cannot give a location in DESCRIPTION. Which makes sense as that file needs to work 'everywhere' whereas your location info is local to your machine.

Resources