issue running notebook from RStudio error 127 - r

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!

Related

How come I cannot install tidyverse in RStudio?

When I type
install.packages("tidyverse")
I get the following
Execution halted
ERROR: lazy loading failed for package ‘dtplyr’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dtplyr’
ERROR: dependency ‘broom’ is not available for package ‘modelr’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/modelr’
ERROR: dependencies ‘broom’, ‘dbplyr’, ‘dtplyr’, ‘googlesheets4’, ‘modelr’, ‘rvest’ are not available for package ‘tidyverse’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/tidyverse’
The downloaded source packages are in
‘/private/var/folders/dp/4s8zzfmn11v13_xvl38yygcr0000gn/T/RtmpSbkirG/downloaded_packages’
There were 15 warnings (use warnings() to see them)
I cannot figure out why tidyverse won't install on my laptop but did on my PC.
I have the latest version of R as well.
Try restoring section with: Ctrl + Shift + F10

clang error trying to install R package `ivreg` on mac

I am attempting to install the ivreg package into R (4.0.3) on my Mac (OS Big Sur Intel Version 11.6.8)
I am having what apparently is a fairly common problem installing its dependencies, but I am receiving a slightly different error message. My error message from the command install.packages('ivreg'):
clang: error: -E or -x required when input is from standard input
clang: error: no such file or directory: 'L/usr/local/gfortran/lib'
make: *** [Matrix.so] Error 1
ERROR: compilation failed for package ‘Matrix’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Matrix’
* restoring previous
‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Matrix’
Warning in install.packages :
installation of package ‘Matrix’ had non-zero exit status
* installing *source* package ‘MatrixModels’ ...
** package ‘MatrixModels’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘Matrix’ 1.2-18 is being loaded, but >= 1.4.2 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘MatrixModels’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/MatrixModels’
Warning in install.packages :
installation of package ‘MatrixModels’ had non-zero exit status
ERROR: dependency ‘MatrixModels’ is not available for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/quantreg’
Warning in install.packages :
installation of package ‘quantreg’ had non-zero exit status
ERROR: dependency ‘quantreg’ is not available for package ‘car’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/car’
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
The instrumental bit appears to be the very first two lines, where it's describing something about a gfortran directory. I've tried to install gfortran as well as all of the other dependencies to no avail. When I attempt to do so, I'm told that the packages are unavailable for my version of R.
QUESTION: Is there a way to alleviate this error and install ivreg on my machine?

Deploy R on Azure on Linux (centos 8.2.2004)

I am trying to install R Shiny on Azure , Linux (centos 8.2.2004). Using the manual : https://linuxize.com/post/how-to-install-r-on-centos-7/
However I can not install packages. I receive error :
"ERROR: failed to lock directory ‘/usr/lib64/R/library’ for modifying Try removing ‘/usr/lib64/R/library/00LOCK-Rcpp’ ERROR: dependency ‘Rcpp’ is not available for package ‘later’
* removing ‘/usr/lib64/R/library/later’ ERROR: dependencies ‘Rcpp’, ‘later’ are not available for package ‘promises’
* removing ‘/usr/lib64/R/library/promises’ ERROR: dependencies ‘Rcpp’, ‘promises’, ‘later’ are not available for package ‘httpuv’
* removing ‘/usr/lib64/R/library/httpuv’ ERROR: dependencies ‘httpuv’, ‘later’, ‘promises’ are not available for package ‘shiny’
* removing ‘/usr/lib64/R/library/shiny’
The downloaded source packages are in
‘/tmp/RtmpGIfMqF/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning messages: 1: In install.packages("shiny") : installation of package ‘Rcpp’ had non-zero exit status 2: In install.packages("shiny") : installation of package ‘later’ had non-zero exit status 3: In install.packages("shiny") : installation of package ‘promises’ had non-zero exit status 4: In install.packages("shiny") : installation of package ‘httpuv’ had non-zero exit status 5: In install.packages("shiny") : installation of package ‘shiny’ had non-zero exit status"
I have tried to fix the issue however , was able. If you have some ideas, please advice, thanks.
I solved the problem finally. There was necessary to delete the folder :
sudo rm -rf /usr/lib64/R/library/00LOCK-Rcpp
Then tried instal shiny package again and worked fine.

ERROR: dependency 'askpass' is not available for package 'credentials' while installing "ssh"

I am trying to install ssh in R version 3.2.5 of windows 10, and
I am getting the below error, can any one help me what could be wrong here?
install.packages("ssh")
#>The downloaded binary packages are in
# C:\Users\xyz\AppData\Local\Temp\Rtmpq0Bnkq\downloaded_packages
#installing the source package ‘credentials’
#trying URL #'https://mirror.its.sfu.ca/mirror/CRAN/src/contrib/credentials_1.1.tar.gz'
#Content type 'application/x-gzip' length 229147 bytes (223 KB)
#downloaded 223 KB
ERROR: dependency 'askpass' is not available for package 'credentials'
* removing 'C:/Users/xyz/Documents/R/win-library/3.2/credentials'
The downloaded source packages are in
‘C:\Users\xyz\AppData\Local\Temp\Rtmpq0Bnkq\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" CMD INSTALL -l "C:\Users\xyz\Documents\R\win-library\3.2" C:\Users\xyz~1\AppData\Local\Temp\Rtmpq0Bnkq/downloaded_packages/credentials_1.1.tar.gz' had status 1
2: In install.packages("ssh") :
installation of package ‘credentials’ had non-zero exit status
Edit:
I have tried the below command suggested by RAB
install.packages("ssh", dependencies=TRUE)
but unfortunately still I am getting similar error:
ERROR: dependency 'askpass' is not available for package 'credentials'
* removing 'C:/Users/xyx/Documents/R/win-library/3.2/credentials'
ERROR: dependency 'stringr' is not available for package 'knitr'
* removing 'C:/Users/xyx/Documents/R/win-library/3.2/knitr'
ERROR: dependencies 'knitr', 'stringr' are not available for package 'rmarkdown'
* removing 'C:/Users/xyx/Documents/R/win-library/3.2/rmarkdown'
ERROR: dependency 'knitr' is not available for package 'spelling'
* removing 'C:/Users/xyx/Documents/R/win-library/3.2/spelling'

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