R – How to update R using conda

anacondar

I installed Rstudio using anaconda. I think the R was also installed alongside with it (but I read somewhere that Rstudio doesn't come with R: Tell me if I am wrong).

From terminal: which R shows :/home/simo/anaconda3/bin/R.

I tried that:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo echo "deb http://cran.wustl.edu/bin/linux/ubuntu bionic-cran35/" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt upgrade

but doesn't upgrade the version of R (still R version 3.5.1 (2018-07-02) -- "Feather Spray")

At the first place I want to install: dashHtmlComponents, a dash library.

> install.packages("dashHtmlComponents")
Warning message:
package ‘dashHtmlComponents’ is not available (for R version 3.5.1) 
>

But from the dash documentation I read that at least version 3.0.2 of R is required.

What is wrong?

Best Answer

It depends what OS you are on how you would go about doing that. The particular methods for Windows and MacOS are laid out on this page.

As far as if you have R (which it appears you do, but nonetheless), you can run install r-essentials --yes in the terminal (Mac) or Anaconda Prompt (PC). In Linux you can follow the steps here.

Once you do either of these, you should be able to use install.packages('dashHtmlComponents'). I am using R version 3.6.2 and it installs just fine.