error installing packages in R. (Windows) - r

I just installed R and Rstudio and I'm new to programming in general.
I just tried to install "ggally" library for data visualization but it's showing me the following repetetive error.
Am I doing something wrong?
ERROR: dependencies 'dplyr', 'ellipsis', 'glue', 'lifecycle', 'magrittr', 'purrr', 'rlang', 'tibble', 'tidyselect', 'vctrs' are not available for package 'tidyr'
* removing 'C:/Users/smain/AppData/Local/R/win-library/4.2/tidyr'
Warning in install.packages :
installation of package ‘tidyr’ had non-zero exit status
ERROR: dependencies 'ggplot2', 'dplyr', 'forcats', 'lifecycle', 'plyr', 'progress', 'reshape', 'rlang', 'scales', 'tidyr' are not available for package 'GGally'
* removing 'C:/Users/smain/AppData/Local/R/win-library/4.2/GGally'
Warning in install.packages :
installation of package ‘GGally’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\smain\AppData\Local\Temp\RtmpI92I7C\downloaded_packages’

I think you should be conservative about it and do two steps first:
1- If you have an active Antivirus on your computer, temporarily disable it.
2- If you use RStudio, close the software, right-click on the icon and choose Run as administrator to open it.
Then, you can re-install the package with the right repository address as below:
install.packages('GGally', dependencies=TRUE, repos="https://CRAN.R-project.org/")
library(GGally)
I hope it helps.

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.

package installation failed after installing R

I try to install the tidyverse and tidytext package in R and it gives me the following error
the message is similar in both I would like to know what is the cause and a possible solution
ERROR: dependencies ‘hunspell’, ‘tokenizers’ are not available for package ‘tidytext’
* removing ‘/home/yeferson/R/x86_64-pc-linux-gnu-library/4.0/tidytext’
Warning in install.packages :
installation of package ‘tidytext’ had non-zero exit status
was installed before R 4.0.0: please re-install it

R: Can't install certain packages

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

Error installing "Quandl" in R 3.1.1

I have installed R 3.1. and RStudio 1.0.44 in BunsenLabs (Debian Jessie)
and I want to install the Quandl package.
In R console I write:
install.packages("Quandl")
and the output is:
ERROR: configuration failed for package ‘openssl’
* removing
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing
ERROR: dependency ‘httr’ is not available for package ‘Quandl’
* removing
Warning in install.packages :
installation of package ‘Quandl’ had non-zero exit status
library(Quandl)
Error in library(Quandl) : there is no package called ‘Quandl’
Thanks,
RTA
Solution, write in linux terminal:
sudo apt-get install r-cran-openssl
Thanks

Cannot install any R packages?

I am using R 3.2.2 on a UNIX server (this is installed to my HOME).
Any package that I try to install returns an error message like this:
install.packages('knitr')
Warning: unable to access index for repository
https://cran.rstudio.com/src/contrib
Warning message:
package ‘knitr’ is not available (for R version 3.2.2)
I've also tried downloading the package source and installing manually, but that doesn't work:
install.packages('/home/baker/knitr_1.11.tar.gz',repos= NULL,type='source')
ERROR: dependencies ‘evaluate’, ‘digest’, ‘formatR’, ‘highr’, ‘markdown’, ‘stringr’, ‘yaml’ are not available for package ‘knitr’
* removing ‘/home/baker/R/lib64/R/library/knitr’
Warning message:
In install.packages("/home/baker/knitr_1.11.tar.gz", repos = NULL, :
installation of package ‘/home/baker/knitr_1.11.tar.gz’ had non-zero exit status
This is obviously a super frustrating problem...any ideas? I'm at a total loss.

Resources