R: Can't install certain packages - r

I noticed that I am unable to install a bunch of packages. It started then I was trying to install the package carat. I would get this long error.
ERROR: compilation failed for package ‘robustbase’
* removing ‘/Users/regiswengel/anaconda/lib/R/library/robustbase’
Warning in install.packages :
installation of package ‘robustbase’ had non-zero exit status
ERROR: dependency ‘robustbase’ is not available for package ‘ddalpha’
* removing ‘/Users/regiswengel/anaconda/lib/R/library/ddalpha’
Warning in install.packages :
installation of package ‘ddalpha’ had non-zero exit status
ERROR: dependency ‘ddalpha’ is not available for package ‘recipes’
* removing ‘/Users/regiswengel/anaconda/lib/R/library/recipes’
Warning in install.packages :
installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/Users/regiswengel/anaconda/lib/R/library/caret’
Warning in install.packages :
installation of package ‘caret’ had non-zero exit status
installing the dependencies ‘robustbase’, ‘ddalpha’, ‘recipes’ individually beforehand doesn't work either.
I also noticed that I am unable to update the packages
cluster
glmnet
maps
PKI
a bunch of others
I'm currently using R version 3.3.2 and RStudio Version 1.0.136. I have been using R and RStudio for months and have never had an issues installing packages. I have done a bunch of searching on Google and Stack-overflow and found some solutions. None of them have worked for me.

The error in my output was
gfortran -fPIC -I/Users/UserName/anaconda/include -L/Users/UserName/anaconda/lib -c eigen.f -o eigen.o
make: gfortran: No such file or directory
I found this thread that provided me with the answer I needed.
OS X package installation depends on gfortran-4.8

Related

Errors when trying to install 'semPlot' R package

I'm trying to install the package 'semPlot' in RStudio, and keep getting errors:
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'rockchalk' in library.dynam(lib, package, package.lib):
DLL 'zip' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Documents/R/win-library/4.0/rockchalk'
Warning in install.packages :
installation of package ‘rockchalk’ had non-zero exit status
ERROR: failed to lock directory 'C:/Documents/R/win-library/4.0' for modifying
Try removing 'C:/Documents/R/win-library/4.0/00LOCK-OpenMx'
Warning in install.packages :
installation of package ‘OpenMx’ had non-zero exit status
ERROR: dependencies 'rockchalk', 'OpenMx' are not available for package 'semPlot'
* removing 'C:/Documents/R/win-library/4.0/semPlot'
Warning in install.packages :
installation of package ‘semPlot’ had non-zero exit status
The downloaded source packages are in
‘C:\AppData\Local\Temp\RtmpE9qK0s\downloaded_packages’
I already installed the package ‘rockchalk’, but it didn't help.
The first time I tried to install 'semPlot' there was an almost endless process which also ended with an error.
You could use the install_github function to install R packages hosted on GitHub from the devtools package. Here is a reproducible example:
devtools::install_github('SachaEpskamp/semPlot')
library(semPlot)
Created on 2022-11-14 with reprex v2.0.2
I solved it by uninstalling R and RStudio, and then installing them, and googling a small problem that came up with tydiverse.

install daewr package in R 4.0

hi i am trying to install package for experiment designs like this
install.packages("daewr", dependencies = T)
but it returns the following
configure: error: GNU MP not found, or not 4.1.4 or up, see http://gmplib.org
ERROR: configuration failed for package ‘gmp’
* removing ‘/home/yeferson/R/x86_64-pc-linux-gnu-library/4.0/gmp’
Warning in install.packages :
installation of package ‘gmp’ had non-zero exit status
ERROR: dependency ‘gmp’ is not available for package ‘partitions’
* removing ‘/home/yeferson/R/x86_64-pc-linux-gnu-library/4.0/partitions’
Warning in install.packages :
installation of package ‘partitions’ had non-zero exit status
ERROR: dependency ‘partitions’ is not available for package ‘DoE.base’
* removing ‘/home/yeferson/R/x86_64-pc-linux-gnu-library/4.0/DoE.base’
Warning in install.packages :
installation of package ‘DoE.base’ had non-zero exit status
ERROR: dependency ‘DoE.base’ is not available for package ‘FrF2’
* removing ‘/home/yeferson/R/x86_64-pc-linux-gnu-library/4.0/FrF2’
Warning in install.packages :
installation of package ‘FrF2’ had non-zero exit status
ERROR: dependency ‘FrF2’ is not available for package ‘daewr’
* removing ‘/home/yeferson/R/x86_64-pc-linux-gnu-library/4.0/daewr’
Warning in install.packages :
installation of package ‘daewr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpB1bSe0/downloaded_packages’
so i decided to download the file from https://cran.r-project.org/web/packages/daewr/index.html
after trying to install it returns me
also installing the dependencies ‘gmp’, ‘partitions’, ‘DoE.base’, ‘FrF2.catlg128’
I try to install the first one but it asks for a Bessel package and it still gives me problems
I solved it by installing dependency one by one, many answer you install the dependencies but they do not say how I will explain them for the new ones in linux and in R to install the daerw package with the aforementioned problems, install the following in the linux console
sudo apt-get install libgsl-dev
with that install libraries now I can open R and install
install.packages('gsl')
then I opened the linux console again and installed
sudo apt-get install libgmp-dev
I go back to R and install
install.packages("gmp", dependencies = T)
now I can install the package without problems
install.packages("daewr", dependencies = T)
library(daewr)
I hope that any comment is welcome.

Can't install Codebook package in R

I am attempting to install the R package "codebook" on OSX. I receive the following error message. I receive similar error messages when I try to independently install these dependencies. Is there a way that I install via the terminal or otherwise install these dependencies?
My apologies if this is not enough information in order to provide guidance. Please let me know and I would be happy to provide additional context. I am using RStudio Version 1.0.136
Thank you
ERROR: compilation failed for package ‘RcppEigen’
installation of package ‘RcppEigen’ had non-zero exit status
ERROR: dependencies ‘lavaan’, ‘OpenMx’, ‘semTools’ are not available for package ‘MBESS’
installation of package ‘MBESS’ had non-zero exit status
ERROR: dependency ‘igraph’ is not available for package ‘DiagrammeR’
installation of package ‘DiagrammeR’ had non-zero exit status
ERROR: dependency ‘RcppEigen’ is not available for package ‘lme4’
installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘DiagrammeR’ is not available for package ‘data.tree’
installation of package ‘data.tree’ had non-zero exit status
ERROR: dependencies ‘car’, ‘data.tree’, ‘DiagrammeR’, ‘lavaan’, ‘lme4’, ‘MBESS’ are not
available for package ‘userfriendlyscience’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/userfriendlyscience’
Warning in install.packages :
installation of package ‘userfriendlyscience’ had non-zero exit status
ERROR: dependency ‘userfriendlyscience’ is not available for package ‘codebook’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/codebook’

How to fix 'libproj not found in standard or given locations' error in r

I'm trying to install the 'agricolae' package on R, but I get an error saying
configure: error: libproj not found in standard or given locations.
ERROR: configuration failed for package ‘sf’
* removing ‘/R/x86_64-pc-linux-gnu-library/3.6/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘spdep’
* removing ‘/R/x86_64-pc-linux-gnu-library/3.6/spdep’
Warning in install.packages :
installation of package ‘spdep’ had non-zero exit status
ERROR: dependency ‘spdep’ is not available for package ‘agricolae’
* removing ‘/R/x86_64-pc-linux-gnu-library/3.6/agricolae’
Warning in install.packages :
installation of package ‘agricolae’ had non-zero exit status
I recently upgraded to Ubuntu 18.04.2 and R version 3.6.0 (2019-04-26) -- "Planting of a Tree" and that's when the problems started.
When I do
$ sudo apt-get install -y libproj-dev
I get:
libproj-dev is already the newest version (5.2.0-1~bionic0).
The error says that package 'sf' is not available for dependency 'spdep'. So you should be attempting to install pkg 'sf'. (I'm on the same OS as you and pkg:agricolae installed without problem just now. I have a more complete set of spatial R and system packages than you do.)
Edit: There have been reports that it was necessary in addressing this problem to create an environment link to the location of your libraries:
$ export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
(From: https://stat.ethz.ch/pipermail/r-sig-geo/2018-August/026740.html which in turn linked to https://gis.stackexchange.com/questions/157059/repairing-broken-gdal-and-proj-4-on-ubuntu, which has so further debugging options mentioned.)

Cannot install ggplot2: "Error in library.dynam(lib, package, package.lib) : shared object ‘stringi.so’ not found"

Last week I upgraded from Ubuntu 14.04 to 14.10. The first time I've tried to use ggplot in RStudio since the update, I'm getting dependancy errors with my ggplot package and its no longer registered as installed (was working fine before). When I try to reinstal ggplot2:
install.packages("ggplot2",dep=TRUE)
The installation fails while trying to install the dependencies. Here's what the tail of the output looks like:
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
ERROR: lazy loading failed for package ‘stringr’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/stringr’
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
ERROR: dependency ‘stringr’ is not available for package ‘reshape2’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependency ‘reshape2’ is not available for package ‘ggplot2’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpWNyAha/downloaded_packages’
I have a feeling this is the line (below) I should be looking at, but I'm not sure how to interprete this error, anyone have any suggestions for me? I really have no idea where to go from here, as I couldent find any other people experiencing the same error as me.
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
Not sure if the Ubuntu upgrade I did relates to this... but I thought'd I'd mention it just in case.
Following #Nick Kennedey's comment, I tried installing stringi like this:
> install.packages("stringi",dep=TRUE)
Which resulted in this error I hadn't seen before:
2015-08-07 10:26:35 (256 KB/s) - ‘/tmp/RtmpQI4Uau/downloaded_packages/stringi_0.5-5.tar.gz’ saved [3639183/3639183]
ERROR: failed to lock directory ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1’ for modifying
Try removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/00LOCK-stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpQI4Uau/downloaded_packages’
> install.packages("stringi",dep=TRUE)
So the I followed the suggestion in the error an removed the LOCK folder.
In the terminal: rm -r /home/james/R/x86_64-pc-linux-gnu-library/3.1/00LOCK-stringi’
Then tried installing the stringi package again, and it worked! This was the issue... now I've just finished installing with no issues.
I am still a little bit confused though... as to how this error can come about. Any ideas on what causes this so I can avoid it in the future? Is it possible it was a symptom of my recent upgrade to 14.10?
Got the same error while installing install.packages("knitr")
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/lib/R/site-library/stringi/libs/stringi.so'
I solved it by doing the below:
In Ubuntu 16.04 and above
sudo apt install r-cran-stringi
In earlier versions (which had apt-get)
sudo apt-get install r-cran-stringi
In my case I solved the problem through installing stringi and ggplot2 from the terminal of linux. The problem has some relation with RStudio.

Resources