Installation issue with tidyverse package - r

I am having trouble installing packages, I was not able to install any. I got the following error in my r console:
ERROR: dependency 'cachem' is not available for package 'memoise'
* removing 'C:/Users/VasquezV/Documents/R/win-library/3.4/memoise'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\VasquezV\Documents\R\win-library\3.4" C:\Users\VasquezV\AppData\Local\Temp\1\RtmpuiYtO1/downloaded_packages/memoise_2.0.1.tar.gz' had status 1
Warning in install.packages :
installation of package ‘memoise’ had non-zero exit status

The major issue with this problem is that the cli package might not be updated as it often shows 3.1.1 installed but 3.3.0 required. Hence you have two solutions:
install.packages(cli) - there are chances that even this step
might fail as the error message is displayed: "Error in unpacking packages."
Uninstall Cran R and R studio and reinstall it or install the package for replacing the existing one to solve the issue.
This will definitely work as I have solved the issue through this way itself.

Related

How to solve expss package loading problem

I would like to install the expss package but it keeps returning an error.
Looked around for other with similar problems and tried re-installing several packages but nothing seems to work. Does anyone have a suggestion how to fixed the problem?
So far i tried re-installing:
install.packages("stringr")
install.packages("knitr")
install.packages("checkmate")
install.packages("htmlwidgets")
install.packages("htmltools")
install.packages("htmlTable")
install.packages("expss")
But Rstudio keeps returning with and error :
Error: package or namespace load failed for ‘expss’:
object 'mtfrm' not found whilst loading namespace 'expss'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/expss’
Warning in install.packages :
installation of package ‘expss’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/cl/5_wnd4b14y7b40zc80n1r3wdkcnbkn/T/RtmpdcLWsn/downloaded_packages’
According to this issue, the current version of expss won't install in versions of R before 4.2. This has recently been fixed in the development version. You could try:
updating your version of R to version 4.2 (probably the simplest solution if you don't need to keep an older version of R)
installing the development version of expss from GitHub: first install the remotes package, then remotes::install_github("gdemin/expss")
install an older version of expss (remotes::install_version("expss", "0.11.1"))

rgl installation in Mac: X11 not found

I am having the same problem as this and this.
I have installed R and rstudio through a conda environment which included r-rgl. I am now trying to install a package within R that requires rgl. However, calling library(rgl) gives the error
Error: package or namespace load failed for ‘rgl’:
package ‘rgl’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
I have tried to install rgl from within R, but then I get this message:
checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ‘rgl’
* removing ‘/path/to/miniconda3/envs/my_conda_env/lib/R/library/rgl’
* restoring previous ‘/path/to/miniconda3/envs/my_conda_env/lib/R/library/rgl’
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/vh/.../downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
The solution to the last error seems to be installing XQuartz in Mac, but I had it installed before. So I tried specifying install.packages("rgl", INSTALL_opts = "--with-libpng-prefix=/usr/X11/") but I still get the error above. Any suggestions? I'm quite lost now...
TL;DR: how do I connect my XQuartz installation with each conda environment that I create?

Cannot install the shiny package in R

I am trying to install the shiny package in R but I keep getting this error:
ERROR: dependencies 'later', 'promises', 'rlang' are not available for
package 'shiny'
* removing 'C:/Users/sawyer.keels/Documents/R/win-library/3.2/shiny'
The downloaded source packages are in
‘C:\Users\sawyer.keels\AppData\Local\Temp\RtmpuWfNw6\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/R/R-32~1.4RE/bin/x64/R" CMD INSTALL -l "C:\Users\sawyer.keels\Documents\R\win-library\3.2" C:\Users\SAWYER~1.KEE\AppData\Local\Temp\RtmpuWfNw6/downloaded_packages/shiny_1.1.0.tar.gz' had status 1
2: In install.packages("shiny") :
installation of package ‘shiny’ had non-zero exit status
If anyone has had this issue in the past I would appreciate the help.
Thanks
Try installing the dependency packages:
install.packages(c("later","promises","rlang"))
After thereafter try to install shiny again:
install.packages("shiny")
Let me know if it works.
I updated r:
install.packages("installr")
and then: updateR()
This made the package run.
Unfortunately, the suggested solution did not solve my case as
I detected the point of glitch as I attempted to install promises, which was magrittr seemed not installed. It was found in the error message lines.
Thus, install.packages("magrittr").
Then promises was installed and httpuv as well.
shiny is now installed normally.
Issue resolved.

Caret package failed to install

I am getting this errors trying to install caret package:
ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’
Warning in install.packages :
installation of package ‘ddalpha’ had non-zero exit status
ERROR: dependency ‘ddalpha’ is not available for package ‘recipes’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/recipes’
Warning in install.packages :
installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/caret’
Warning in install.packages :
installation of package ‘caret’ had non-zero exit status
Any ideas?
install.packages("ddalpha")
It gives the same error:
/usr/lib64/R/library/BH/include/boost/exception/exception.hpp:137: error: expected declaration before end of line
make: *** [AlphaProcedure.o] Error 1
ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’
I have found a solution.
I had the same problem. After installing caret with all its dependencies, ddalpha was not installed. Then I tried installing the package ddalpha alone. I got the message:
" There is a binary version available but the source version is later:
binary source needs_compilation
ddalpha 1.2.1 1.3.1 TRUE
Do you want to install from sources the package which needs compilation?
y/n: n"
Well, if I anwser yes, it doesn't work. But when I answer no, it does work. It looks like the new version has some problem, but the previous one works fine.
As Roman indicated in the comments, ddalpha and recipes are dependencies that aren't installed yet. You can manually install them as follows:
install.packages(c('ddalpha', 'recipes'))
Alternatively, you can tell the install.packages() command to grab the necessary packages during the install process.
install.packages('caret', dependencies=TRUE)
Or list them explicitly:
install.packages('caret', dependencies=c('ddalpha', 'recipes'))
Or, if you use an IDE such as RStudio, the package manager that's included will automatically handle these dependencies for you.
If these suggestions don't solve the problem, you may try updating your instance of R to the latest (3.4.1 as I write this). Also, ddalpha is dependent on the Rcpp package version 0.11.0 or greater, so you may update that package.
update.packages('Rcpp')
I was facing the same issues, and I had tried almost all the methods mentioned here. But the only one that worked for me was updating my IDE and that sorted it out.
I had the same issue, running
install.packages('caret', dependencies=TRUE)
from console solved it. I don't know why at the packages window install with "install dependencies" checked didn't work..
R studio: 2022.07.1
R: 3.6.3

Causes of "Error: package '_____' was built before 3.0.0: please re-install it" in R

On one computer running R 2.15.2 I have installed packages from a .zip file (these packages happened to be ggplot2 and data.table, but I don't think the specific package is my issue.) Everything works fine. I took these packages to a computer without an internet connection and installed them. This other computer is running R 3.0.1. The packages seemed to install without a problem (using R's "install package(s) from local zip file" option). When I call the packages with the library(), I get the following error:
Error: package '<insert name of newly installed package here>' was build before 3.0.0: please-re-install it
Can anyone explain potential causes for this error to be thrown? Are there particular directories that the .zip packages must be in for a proper install? If R is installed on a separate partition from where the .zip packages were loaded, could this cause the error?
I'm at a loss, any pointers are greatly appreciated. This is a difficult one to reproduce; if you need any other version/system parameters to understand the problem, please don't hesitate to ask.
I found this solution while look at GitHub ggplot2 issue #796
update.packages(checkBuilt = TRUE, ask = FALSE)
It will update all the packages that need to be reinstalled.
Running install.packages("codetools") can fix this issue for R 3.0.2, if you have the same problem like me:
installing to /home/user/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/libs
** R
** inst
** preparing package for lazy loading
Error : package ‘**codetools**’ was built before R 3.0.0: please re-install it
Error : unable to load R code in package ‘Rcpp’
ERROR: lazy loading failed for package ‘Rcpp’
I installed shiny according https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions
and got the same error at the step
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Warning messages:
1: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘httpuv’ had non-zero exit status
3: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘shiny’ had non-zero exit status
I tried the answer by Richard Lee by starting R
R
and got the error
Warning in install.packages("shiny") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) n
Error in install.packages("shiny") : unable to install packages
obviously no write permission, so
sudo R
Now I tried again
install.packages("shiny")
and got a number of errors
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : package ‘RJSONIO’ was built before R 3.0.0: please re-install it
Error : package ‘caTools’ was built before R 3.0.0: please re-install it
Error : package ‘bitops’ was built before R 3.0.0: please re-install it
Error : package ‘digest’ was built before R 3.0.0: please re-install it
Error : package ‘xtable’ was built before R 3.0.0: please re-install it
Each time I got an error, I re-installed the requested package
install.packages("codetools")
install.packages("RJSONIO")
etc.
and eventually, I was able to install Rccp, httpuv, and even shiny.
Now it works!!
Also see
Shiny package installation on R version 3.0.2 "Frisbee Sailing"
I am using rkward on precise
I had a similar error using rkward. Specifically this one:
'lib = "/usr/local/lib/R/site-library"' is not writable
I temporarily changed the permissions for this directory so that rkward could run this from its console:
update.packages(checkBuilt = TRUE, ask = FALSE)
all to fix this:
Error: package '' was build before 3.0.0: please-re-install it
so that (sigh...) I could fix 'default' configuration for audio on precise. I couldn't use play() etc. in rkward.
That just needed phonon-backend-gtstreamer
I tried to install swirl on R(v3.1.0) on ubuntu 12.04LTS:
sudo R
install.packages("swirl")
But faced a similar error:
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : unable to load R code in package ‘httr’
ERROR: lazy loading failed for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’
ERROR: dependencies ‘testthat’, ‘httr’ are not available for package ‘swirl’
* removing ‘/usr/local/lib/R/site-library/swirl’
Doing following helped me:
install.packages('codetools')
install.packages("swirl")
library("swirl")
swirl()
| Welcome to swirl! Please sign in. If you've been here before, use the same
| name as you did then. If you are new, call yourself something unique.
What shall I call you?
I hope the same may help fix your installation issue.
Here is the work-around that I used:
I installed the latest version of R on an internet-capable computer. I then loaded the my required packages (Packages->install packages->select mirror->select package...
After R is finished installing, it displays a message of where the temporary .zip package is located. I navigated to this location, grabbed the temp package, and burnt it to a cd.
In this way, I could get the newer package build onto a computer without internet access. I would still be interested to know if there is an easy way to rebuild a package downloaded on an early R version to make it compatible with the latest version (without needed an internet connection).
Thanks for pointing me in the right direction #JoshuaUlrich

Resources