Install Rtools/devtools in R on Ubuntu 20.04 Server

​Record: After successfully installing R on the Ubuntu server, the author couldn't wait to reproduce the bio-code in an article. One of the functions needs to use the install_github() function to import a library written by others from Github, but found that in R Without this function, I found out that I have not installed devtools successfully , and the install_github() function is in the devtools tool, so I need to install devtools again. During the installation process, it was found that the installation method of devtools in Ubuntu server seems to be different from that in Windows (it may also be caused by version reasons), but the reason was not investigated, and only the installation methods under the two systems were sorted out.

1. Install Rtools on Ubuntu server R (the installation method I use on Ubuntu)

  • install.packages("installr")(Rtools cannot be installed through the regular install.packages() command, but can be installed through the installr package)
  • install.packages("stringr")
  • library(stringr)
  • library(installr)
  • install.Rtools()

2. Install devtools on Ubuntu Server R

  • sudo apt-get install gfortran
  • sudo apt-get install build-essential
  • sudo apt-get install libxt-dev
  • sudo apt-get install libcurl4-openssl-dev
  • sudo apt-get install libxml++2.6-dev
  • sudo apt-get install libssl-dev
  • install.packages("devtools")

Execute the above commands in sequence, and then import devtoolsthe package to use install_github()the function

3. Install Rtools and devtools in R in Windows

In the Windows system, I refer to the content of two blogs to install, and the introduction is very detailed, transfer: blog-1 , blog-2

Guess you like

Origin blog.csdn.net/zxk_75/article/details/123896079
Recommended