Cannot install any R packages? - r

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.

Related

error installing packages in R. (Windows)

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.

issue running notebook from RStudio error 127

running on linux mint.
When I try to start a new notebook file I get the following dialogue.
"Create R Notebook requires updated versions of the following packages: digest, highr, htmltools, jquerylib, knitr, markdown, rmarkdown, stringi, stringr, tinytex, xfun. "
I select upgrade and it tries to install the packages but throws the following error
/bin/bash: line 2: g++: command not found
make: *** [/usr/share/R/share/make/shlib.mk:6: xfun.so] Error 127
ERROR: compilation failed for package ‘xfun’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/xfun’
ERROR: dependency ‘xfun’ is not available for package ‘highr’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/highr’
ERROR: dependencies ‘digest’, ‘rlang’, ‘fastmap’ are not available for package ‘htmltools’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/htmltools’
ERROR: dependency ‘xfun’ is not available for package ‘tinytex’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/tinytex’
ERROR: dependency ‘stringi’ is not available for package ‘stringr’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/stringr’
ERROR: dependencies ‘highr’, ‘stringr’, ‘xfun’ are not available for package ‘knitr’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/knitr’
ERROR: dependency ‘htmltools’ is not available for package ‘jquerylib’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/jquerylib’
ERROR: dependencies ‘knitr’, ‘htmltools’, ‘tinytex’, ‘xfun’, ‘jquerylib’, ‘stringr’ are not available for package ‘rmarkdown’
* removing ‘/home/hadwll/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown’
RStudio is the latest version.
The goal is to run an R notebook in some form so if anyone could recommend a good how to that would also be fine!

Error installing Broom and Nlme package in R

I am currently using RStudio for R right now. I am trying to use the broom::tidy function but am unable to install the broom package.
install.packages("broom")
generates the error:
ERROR: dependency ‘nlme’ is not available for package ‘psych’
* removing ‘/home/gherr/R/x86_64-pc-linux-gnu-library/3.2/psych’
Warning in install.packages :
installation of package ‘psych’ had non-zero exit status
ERROR: dependencies ‘psych’, ‘nlme’ are not available for package ‘broom’
* removing ‘/home/gherr/R/x86_64-pc-linux-gnu-library/3.2/broom’
Warning in install.packages :
installation of package ‘broom’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpwPtSkh/downloaded_packages’
install.packages("nlme")
generates this error:
Installing package into ‘/home/gherr/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘nlme’ is not available (for R version 3.2.3)
It appears that I am only unable to install the 'nlme' package and the other two installs are failing because it is a dependency.

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

cant install plyr package via command line or manually

on typing
install.packages("ggplot2")
i get the following result:
Installing package into ‘/home/suraj/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: dependency ‘plyr’ is not available
also installing the dependencies ‘reshape2’, ‘scales’
ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/suraj/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
ERROR: dependency ‘plyr’ is not available for package ‘scales’
* removing ‘/home/suraj/R/x86_64-pc-linux-gnu-library/3.0/scales’
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/suraj/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
The downloaded source packages are in
‘/tmp/RtmpSWlplq/downloaded_packages’
Warning messages:
1: In install.packages("ggplot2") :
installation of package ‘reshape2’ had non-zero exit status
2: In install.packages("ggplot2") :
installation of package ‘scales’ had non-zero exit status
3: In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
when i tried to install 'plyr' package by first downloading the plyr package and the using
install.packages("plyr_1.8.2.tar.gz",repos=NULL,type="source")
i get the following message:
Installing package into ‘/home/suraj/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
ERROR: this R is version 3.0.2, package 'plyr' requires R >= 3.1.0
Warning message:
In install.packages("plyr_1.8.2.tar.gz", repos = NULL, type = "source") :
installation of package ‘plyr_1.8.2.tar.gz’ had non-zero exit status
install.packages("plyr_1.8.2.tar.gz",repos=NULL)
Installing package into ‘/home/suraj/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
ERROR: this R is version 3.0.2, package 'plyr' requires R >= 3.1.0
Warning message:
In install.packages("plyr_1.8.2.tar.gz", repos = NULL) :
installation of package ‘plyr_1.8.2.tar.gz’ had non-zero exit status
plase can anyone guide me in this matter!
Install version 1.8.1 of plyr from http://cran.r-project.org/src/contrib/Archive/plyr
and everything works like a charm thanks to #nicola for helping me on this one
For Windows, the appropriate version of plyr can be found in the R 3.0 Windows Package Archive.

Resources