R installation through conda runs into error - r

I am installing R through conda as follows on Ubuntu 18.04.
v=3.6.0
conda create -n env-r${v} -c r r=${v} r-ggplot2 r-gridExtra r-gtable r-tidyr r-devtools
conda activate env-r${v}
That runs ok. It installs 3.6.1 instead of 3.6.0. And then when I use R, for example, installing a package not on conda;
Rscript -e 'install.packages("label.switching", repos="https://cran.rstudio.com")'
I get this error:
Error in path.expand(new) : object 'lb' not found
Calls: .First ... .libPaths -> Sys.glob -> path.expand -> path.expand
Execution halted
If I open R and run stuff in it, there are more errors:
Error in path.expand(new) : object 'lb' not found
Calls: .First ... .libPaths -> Sys.glob -> path.expand -> path.expand
Execution halted
Error in i.p(...) :
(converted from warning) installation of package ‘rlang’ had non-zero exit status
Running conda 4.7.5.
Ran sessionInfo() inside R.
>> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS/LAPACK: /home/roy/miniconda3/envs/env-r3.6.0/lib/libopenblasp-r0.3.6.so
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.1

Related

How do I install R packages from VSCode using global site-library

I'm having trouble installing R packages from VSCode using the R extension v5.2.3. The directory /usr/local/lib/R/site-library that VSCode is trying to write to is not writeable. This is the directory that is used when I start R as root and install R packages from the console. This is where I want my R packages to live.
This is the error I get when using VSCode to install the R package here. Note that I start VSCode as a normal user.
Executing task: /usr/bin/R --silent --slave -e install.packages(c('here'),repos='https://cloud.r-project.org/')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages(c("here"), repos = "https://cloud.r-project.org/") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Error in install.packages(c("here"), repos = "https://cloud.r-project.org/") :
unable to install packages
Execution halted
* The terminal process "/usr/bin/R '--silent', '--slave', '-e', 'install.packages(c('here'),repos='https://cloud.r-project.org/')'" failed to launch (exit code: 1).
* Terminal will be reused by tasks, press any key to close it.
This post describe the same error on windows. But with no solution...
So, is there a way to manage my R packages from VSCode using the global library /usr/local/lib/R/site-library?
My Linux info:
~$ uname -rvmpo
5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 GNU/Linux
And the R ditto:
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 20.3
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=sv_SE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=sv_SE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.1

Load failed for ‘RCurl’ in dyn.load: unable to load shared object - Rstudio - openSuse

I'm having problem installing "Rcurl" in Rstudio on opensuse 15.2. I have installed Rstudio from the OS repository, I have been searching for similar questions and answers, and found this other question which I think it's the closest one to mine but in Ubuntu. Following some suggestions I didn't get to solve the problem in my case. Here is the error I get:
Error: package or namespace load failed for ‘RCurl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/alcides/R/x86_64-suse-linux-gnu-library/3.5/RCurl/libs/RCurl.so':
libicui18n.so.58: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/username/R/x86_64-suse-linux-gnu-library/3.5/RCurl’
Warning in install.packages :
installation of package ‘RCurl’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpKXseTK/downloaded_packages’
This is my session info
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Leap 15.2
Matrix products: default
BLAS: /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0
Thanks
I reproduced the error and at first I couldn't install RCurl. The way I solved is by installing:
sudo zypper install libcurl-devel
And then from R
install.packages ("RCurl")
Among the packages available for Leap 15.2 is also R-RCurl-1.95_4.11-lp152.6.7.x86_64.rpm, but it is for R 4.0.2, not 3.5 like the one you use.

Cannot access repositories on R (in Ubuntu), except for attemps on "vanilla" session

I have reproduced this error in R versions 3.2.3 and 3.4.4; running both through terminal or within RStudio GUI. My OS is Ubuntu Linux 16.04 LTS. The problem started this week.
I found that the problem does not occur on a R --vanilla session.
When I start R, I get this message:
Warning: unable to access index for repository http://www.vps.fmvz.usp.br/CRAN/src/contrib: no fue posible abrir la URL 'http://www.vps.fmvz.usp.br/CRAN/src/contrib/PACKAGES'
Next, when I try to install a package I get:
Warning in install.packages :
cannot open URL 'http://www.vps.fmvz.usp.br/CRAN/src/contrib/PACKAGES.gz': HTTP status was '403 Forbidden'
Warning in install.packages :
cannot open URL 'http://www.vps.fmvz.usp.br/CRAN/src/contrib/PACKAGES': HTTP status was '403 Forbidden'
Warning in install.packages :
unable to access index for repository http://www.vps.fmvz.usp.br/CRAN/src/contrib:
no fue posible abrir la URL 'http://www.vps.fmvz.usp.br/CRAN/src/contrib/PACKAGES'
My session info is:
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS
locale:
[1] LC_CTYPE=es_AR.UTF-8 LC_NUMERIC=C
[3] LC_TIME=es_AR.UTF-8 LC_COLLATE=es_AR.UTF-8
[5] LC_MONETARY=es_AR.UTF-8 LC_MESSAGES=es_AR.UTF-8
[7] LC_PAPER=es_AR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=es_AR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] tools_3.2.3
The current repository is (but I have already tried with several repositories):
getOption("repos")
CRAN
"http://www.vps.fmvz.usp.br/CRAN/"
attr(,"RStudio")
[1] TRUE
I would appreciate any help.

Install package geogrid in R

I have the following code, basic a error message in R. Please what can i do about. I don t know what to do. error message. Please send me codes,
Hello guys i am trying to use R with Rstudio please
RcppExports.cpp:4:27: fatal error: RcppArmadillo.h: Arquivo ou diretório não encontrado compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'RcppExports.o' failed
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘geogrid’
* removing ‘/home/gabriel/R/x86_64-pc-linux-gnu-library/3.4/geogrid’
Warning in install.packages :
installation of package ‘geogrid’ had non-zero exit status
SEssion INFO
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=pt_BR.UTF-8
[2] LC_NUMERIC=C
[3] LC_TIME=pt_BR.UTF-8
[4] LC_COLLATE=pt_BR.UTF-8
[5] LC_MONETARY=pt_BR.UTF-8
[6] LC_MESSAGES=pt_BR.UTF-8
[7] LC_PAPER=pt_BR.UTF-8
[8] LC_NAME=C
[9] LC_ADDRESS=C
[10] LC_TELEPHONE=C
[11] LC_MEASUREMENT=pt_BR.UTF-8
[12] LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.7.6 ggplot2_3.0.0
loaded via a namespace (and not attached):
The non-zero exit status simply indicates that there was an error during the installation of the "package".
File link https://cran.r-project.org/src/contrib/geogrid_0.1.0.1.tar.gz
Try with the following command:
install.packages('FILE_PATH', repos=NULL, type = "source",dependencies = TRUE)
Doing so, all the dependencies for the package will also be downloaded.
Downloading from source will recompile the package and installs.

stringi package won't install in CentOS

I am trying to install stringi package in R, but the installation never finishes. After the download and some compilation, I get the following message:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/marcus/R/x86_64-redhat-linux-gnu-library/3.3/stringi/libs/stringi.so':
/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/marcus/R/x86_64-redhat-linux-gnu-library/3.3/stringi/libs/stringi.so)
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/marcus/R/x86_64-redhat-linux-gnu-library/3.3/stringi’
The downloaded source packages are in
‘/tmp/RtmpT5KQVP/downloaded_packages’
Warning message:
In install.packages("stringi") :
installation of package ‘stringi’ had non-zero exit status
I searched the internet and I couldn't understand what this error message means. If it helps, this is my sessionInfo():
R version 3.3.1 (2016-06-21)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.1
I solved my problem installing gcc 4.9.2. To do so, I ran
$ sudo yum install devtoolset-3-gcc-c++
$ sudo yum install devtoolset-3-gcc-gfortran
$ scl enable devtoolset-3 bash
in the shell. The first two commands install gcc and gfortran. The last one makes gcc 4.9.2 the standard compiler in the system. After that, I opened R and ran install.packages("stringi") to have my problem solved.

Resources