unable to upgrade R on aws instance of ubuntu - r

I'm trying up grade R (currently 3.1.3) to the latest using
sudo apt-get install r-base-dev
and get the message that I'm already on the latest:
Reading package lists... Done
Building dependency tree
Reading state information... Done
r-base-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Here is my current version
R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
So I am clearly not on the latest version.

Related

Cannot install latest R version on Google Cloud

I am trying to set up Rstudio on an Ubuntu cloud server (gcloud). I currently have version R-3.4.4 on RStudio, but would like to upgrade. The issue is, I am unable to.
I am running the following version of Ubuntu.
name#sc1:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
I installed the RStudio server for Ubuntu 18 as suggested here: https://www.rstudio.com/products/rstudio/download-server/debian-ubuntu/
So essentially running to install the server:
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1717-amd64.deb
sudo gdebi rstudio-server-1.4.1717-amd64.deb
Checking the version of R Studio I have:
sudo -i R
Output:
name#sc1:~$ sudo -i R
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
However, this is what pops up in my RStudio.
Anyone have ideas for what I'm doing wrong? How can I upgrade my package?
Furthermore, in my /home/user/R/x86_64-pc-linux-gnu-library directory, I have an R-3.4 folder, which is confusing…
Turns out that after I installed R 4.0, I had to restarted the VM and that seemed to work. Unclear why this is, but at least it worked!

How to install R language version 4 in AWS EMR - Amazon linux 2

We have an AWS EMR cluster. By default it comes with
Amazon Linux version 2
R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
I like to install latest R version 4..
Tried following :
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install R
But it doesn't upgrade R version to v4.0. It only offers to upgrade it to 3.4.3-1.amzn2.0.1
Amazon Linux 2 - uses EPEL version 7. EPEL v7 doesn't seem to have R v4.
But EPEL version 8 has R v4
I am planning to install R from source. But like to know if this is a way to install binary.
Is there any option to install latest R binary on AWS Linux 2 ?
Found a way to install the R v4 binary from AWS extras repo
sudo amazon-linux-extras install R4
In future, if some one is hunting for AWS Linux specific software package., this command list the packages that can be installed from AWS extras
amazon-linux-extras list
Reference - Amazon Linux User Guide
Install miniconda https://docs.conda.io/en/latest/miniconda.html
conda install r-base or conda install r-essentials

Is it possible to create an r conda environment from an existing version of r?

I had R 3.6 installed on my computer a long time ago and it has all of the packages that I typically use. I wanted to make a jupyter notebook using this version of R, however my R conda environment is a different version of r and has none of my typical packages. Is there a way to create a new R conda environment from my non-conda version of R? And/or, is there still a way I can use my preferred non-conda version of R as a kernel in Jupyter Notebooks?
No, a non-Conda version of R cannot be used as a basis for a Conda environment.
However, it is possible to use any R installation as a kernel in Jupyter, no matter where either are installed. The key to doing so is to install IRkernel package in the R environment.
Steps for Registering R as a Jupyter Kernel
If the Jupyter is installed in a Conda env, e.g., my_jupyter_env, first activate that env:
$ conda activate my_jupyter_env
(my_jupyter_env) $
Otherwise, i.e., jupyter is on PATH, then just continue without any Conda envs activated.
Start an R session using the native R:
(my_jypyter_env) $ path/to/native/R
Install IRkernel:
> install.packages("IRkernel")
Note that if this R is in a Conda env, instead use conda install r-irkernel outside of the R session.
From the R session, register R as a kernel. For example, if I had an R 3.6.0 natively installed I might call it:
> IRkernel::installspec(name="ir36_native", displayname="R 3.6.0 (native)")
but the arguments are whatever you want.
Quit the session and start Jupyter.
> q()
(my_jupyter_env) $ jupyter notebook
Use the "New" button to create a new notebook and select the R kernel from the dropdown.
Yes it is possible. You can run conda search r-base which in my case returns
Loading channels: done
# Name Version Build Channel
r-base 3.1.2 0 pkgs/r
r-base 3.1.3 0 pkgs/r
r-base 3.1.3 1 pkgs/r
r-base 3.1.3 2 pkgs/r
r-base 3.2.0 0 pkgs/r
r-base 3.2.1 0 pkgs/r
r-base 3.2.2 0 pkgs/r
r-base 3.3.1 1 pkgs/r
r-base 3.3.1 2 pkgs/r
r-base 3.3.1 3 pkgs/r
r-base 3.3.1 5 pkgs/r
r-base 3.3.1 6 pkgs/r
r-base 3.3.2 0 pkgs/r
r-base 3.3.2 1 pkgs/r
r-base 3.4.1 0 pkgs/r
r-base 3.4.1 1 pkgs/r
r-base 3.4.2 haf99962_0 pkgs/r
r-base 3.4.3 h1c2f66e_4 pkgs/r
r-base 3.4.3 h1e0a451_2 pkgs/r
r-base 3.4.3 h290ecf8_0 pkgs/r
r-base 3.4.3 h290ecf8_1 pkgs/r
r-base 3.4.3 h9bb98a2_5 pkgs/r
r-base 3.5.0 h1c2f66e_1 pkgs/r
r-base 3.5.0 h1e0a451_1 pkgs/r
r-base 3.5.1 h1e0a451_2 pkgs/r
r-base 3.5.3 h067a564_0 pkgs/r
r-base 3.5.3 h26b83e4_0 pkgs/r
r-base 3.6.0 hce969dd_0 pkgs/r
r-base 3.6.1 h9bb98a2_1 pkgs/r
r-base 3.6.1 haffb61f_2 pkgs/r
r-base 3.6.1 hce969dd_0 pkgs/r
and you install your favorite version with conda install r-base=x.x.x

unable to install car package in r 3.5.2

I am running R 3.5.2 on Ubuntu 18.4 lts and trying to install car package. I am getting bellow error.
Please just run
sudo apt-get install r-cran-car
as the package has been part of Debian and Ubuntu for a decade and a half (maintained by yours truly). We provide binaries because installation from source is not for everybody.

RCurl Installation in R 3.1.1: package 'RCurl' is not available (for R version 3.1.1)?

It says in Cran that RCurl should be for R >3.0.0 but R 3.1.1 in Debian Jessie fires the error:
package 'RCurl' is not available (for R version 3)
the same problem with rjson. The dependencies are libcurl and make that are installed. What is the problem with R 3.1.1 in installing the libcurl packages such as RCurl? How to overcome this the most convenient way?
P.s. I know this thread but any method did not solve this issue.
Apt-get install the 3.1.1 R version by default, for example in Debian Jessie. We can either install the newest version of R with the newest RCurl or install the archived version of RCurl working in R 3.1.1.
Solution A
You can install the newest version, source, such that
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/debian jessie-cran3/" >> /etc/apt/sources.list'
sudo apt-key adv --keyserver subkeys.pgp.net --recv-key 381BA480
sudo apt-get update
sudo apt-get install r-base r-base-dev
and now you can install RCurl in R, working in R 3.3.2.
Solution B
Install the Curl from the CRAN Archieves matching the 3.1.1 R, apparently this here as suggested by Imo in the comment.

Resources