How can I update R using conda?

12,249

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.

Share:
12,249

Related videos on Youtube

mhannani
Author by

mhannani

I have been working with different technologies since 2012 including but currently limited to R, Nodejs, Python, JavaScript,Flutter/Dart . I am very interested in machine learning and data mining ...

Updated on June 04, 2022

Comments

  • mhannani
    mhannani almost 2 years

    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?

    • Phil
      Phil almost 4 years
      RStudio is just an IDE for R. It does not install with R, or vice-versa.
    • mhannani
      mhannani almost 4 years
      Yeah ,That's what i was expecting .Thank you
    • daniel_hck
      daniel_hck over 3 years
      Probably you have two versions of R: /home/[user]/anaconda3/envs/[env]/bin/R and in /usr/bin/R You have updated one, but not the one linked to your conda env?. Sorry other users voted you down (-2), they did not understand you. I added +1
  • mhannani
    mhannani almost 4 years
    I'm using linux 19.3 ,so i can't use the installr package and sudo apt-get install r-essentials --yes says E: Unable to locate package r-essential ,i think that the problem is it cannot locate the R since it under Anaconda .. Thank you
  • Todd Burus
    Todd Burus almost 4 years
    You should use install r-essentials inside Anaconda. Maybe try this: evanwill.github.io/_drafts/notes/r-linux.html
  • Dirk Eddelbuettel
    Dirk Eddelbuettel almost 4 years
    This answer is somewhere between confusing and misleading as installr is only for Windows as its DESCRIPTION clearly shows.
  • Dirk Eddelbuettel
    Dirk Eddelbuettel almost 4 years
    Your first comment is also confused. There is no "Linux 19.3". Maybe that is your Mint release, I can't tell. In any event, mixing the package management of your distribution AND conda is a genuinely bad idea. Stick with either your distro for R, or with Conda. Not half-and-half.
  • Dirk Eddelbuettel
    Dirk Eddelbuettel almost 4 years
    The single best resource, in my mind, for R on (.deb based) Linux is the r-sig-debian list for Debian, Ubuntu, and their derivatives. Try it, it's free anyway.
  • Todd Burus
    Todd Burus almost 4 years
    @DirkEddelbuettel Thank you for issuing this correction. I misspoke originally and have corrected it.
  • Dirk Eddelbuettel
    Dirk Eddelbuettel almost 4 years
    @ToddBurys No worries, it happens. Easy to overlook details. That's why it is good we do this in the open with the means to correct and edit.
  • mhannani
    mhannani almost 4 years
    @DirkEddelbuettel I meant linux mint 19.3 thank you for correcting ,So how can i just update the R in Anaconda if that possible ,Thank you