Error in loadNamespace(name) : there is no package called 'RInside' - r

Error in loadNamespace(name) : there is no package called 'Rcpp'
...
Error in loadNamespace(name) : there is no package called 'RInside'
I get the above error when trying make on the examples of RInside.
RInside is in the user-library. So I set R_LIBS_USER to the directory in the Makefile.
R_LIBS_USER := "C:/users/Me/Documents/R/win-library/3.0"
but that does not work either.
Thanks for any advice.
EDIT:
It works fine if the packages are in "C:/R/R-3.0.2/library". R_LIBS_USER doesn't seem to work on Windows.

I fear this is local to your end.
If Rcpp and RInside are in fact in your default library location (and on Windows I sometimes copy them) then the examples build, as does the rest of the package. Recall that all this works for CRAN and the win-builder.

I was also having the same problem and read Dirk's reply and just ran
install.packages("Rcpp", dependencies = TRUE)
install.packages("RInside", dependencies = TRUE)
and it is working fine now.

I know the question was asked long back. But I faced the same problem while using R from python (Anaconda). Also I didnt find an reasonable explanation for it. Finally this is what worked for me.
import rpy2.robjects as ro
ro.r('''.libPaths('C:/Users/<remaining path>/R/win-library/3.1')''')
RSVM = importr('e1071')

Related

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!

Trouble accessing help documentation for a package I created

I'm new to R so I hope this isn't incredibly obvious. I created a package that contains two functions. I provided documentation using roxygen2 for each of the functions, documented and built the package as well as installed and restarted multiple times. I also pushed it up to github and have done everything I can think of to do, yet I cannot access the help files that I created. I always receive this error:
No documentation for ‘myfunc’ in specified packages and libraries: you
could try ‘??myfunc’
Not only is ?myfunc not working, but when I attempt to install my own package to my own RStudio console, but I also receive this error:
Warning in install.packages : package ‘yourpackage*’ is not
available (for R version 3.6.1)
What exactly is going wrong here, and how can I attempt to fix it? I've built packages before and this time I've followed all the same steps I've been taught to use and have used in the past, but for some reason, I'm being met with these errors. I would appreciate any and all help you all have to offer. Thank you in advance!

RStudio installation - yaml error messages

Having some issues helping a colleague at work install RStudio. She was getting the following error message whenever she opened up the programme and when trying to install new packages.
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Seems to be the error that's being discussed here. We've followed the steps in the answers and haven't had any luck.
Uninstalled the yaml package, reinstalled RStudio and got a different error message (not surprising given the package was no longer installed).
Error in loadNamespace(name) : there is no package called ‘yaml’
Error in loadNamespace(name) : there is no package called ‘yaml’
Then tried each of the answers in the link and ended up with the original error message again.
Beyond what I've googled in the past 15 minutes, I don't know anything about yaml or what it's supposed to do. Opening R rather than RStudio seems to work as it should.
R version is 3.4.3, RStudio is 1.1.423 for Windows and yaml version that was originally installed was 2.1.16. Not sure if it's relevant, but we are on work laptops that require us to install new programmes (and in the case of R, packages) into C:\Users\NAME\Desktop\My Software, but that seems to have been done correctly.
Any help greatly appreciated.
Thanks,
James

Error: package or namespace load failed for ‘arulesViz’: object ‘cividis’ is not exported by 'namespace:viridisLite'

In R 3.4.3 (Windows 10) while loading the packages arulesViz:
Error: package or namespace load failed for ‘arulesViz’: object ‘cividis’ is not exported by 'namespace:viridisLite'
I tried to uninstall and install, but did not help. What is wrong and how can i correct it?
Basically you need to install the dependencies of arulesViz.
I tried with Scatterplot3d , viznetwork, vcd, virdislite.
I also faced similar problem.
This problem can be resolved by installing package "viridisLite" along with "arulesViz"
for me it worked no need to reinstallthe R or Rstudio
It get solved , after reinstall RStudio + removed old version of R.
Disadvantage is all libraries will also get removed. So you have to load again.
I had the same issue with the seriation package. Ultimately I found that I just had to uninstall and reinstall r and r studio. Then i ran update.packages() and I had no problems.
This is a pain, as there are several packages with dependencies for packages which in turn import viridisLite, and this error is very opaque for users...
One thing I've found works (apart from manually install.packages("") each package mentioned in the error) is to switch repositories to the RStudio-maintained Cloud repo. (repo 0).
The problem seems to have hit people with a default repo that has incompatible versions of packages at the time people use it, and the cloud repo seems to avoid/not suffer from this problem.
Hope this helps

Error in installing R package "AppliedPredictiveModeling"

I am learning ML from Applied Predictive Modeling book, while installing AppliedPredictiveModeling package I am getting following error
install.packages("AppliedPredictiveModeling")
Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances License
License_is_FOSS License_restricts_use OS_type Archs MD5sum NeedsCompilation Built
I tried looking on Google and SO to resolve this but was unable to find any solution. Please tell me how to resolve this, I have never encountered this error before. I use RStudio on Windows 7.
I found that I was generating this error message when I mistakenly typed
installed.packages("Hmisc")
Instead of the (correct)
install.packages("Hmisc")
since no one was able to help me on this issue, I guess perhaps it was not a common problem, but I solved it finally by installing the package offline.
You are mistyping install.packages as installed.packages. That's all. Just use the correct install.packages() function.
I encountered the same error when attempting to install the car package using
install.packages("car")
The response / error message I got was:
Package LibPath Version Priority Depends Imports LinkingTo Suggests
Enhances License License_is_FOSS License_restricts_use OS_type Archs
MD5sum NeedsCompilation Built
I was in the middle of an R session (RStudio, on Windows 10) when I first attempted to install it.
I fixed it by closing RStudio, and then re-running
install.packages("car")
as the first command I ran upon reopening RStudio.
Perhaps not a definitive solution, but thought it might help others.
Restarting my computer worked for me.
I was having the same issue with:
install.packages('rpart.plot')
Just restarting Rstudio did not work.
Try setting the "dependencies" method to TRUE. That helped me when installing it.

Resources