error: could not find function install_github for R version 2.15.2

AliciaC picture AliciaC · Apr 22, 2014 · Viewed 17.6k times · Source

I'm having multiple problems with R right now but I want to start asking one of the most fundamental questions.

I want to install GitHub files into R, but for some reason the install_github function doesn't seem to exist. For example, when I type:

install_github("devtools")

I get

error: could not find function install_github

The install_packages function worked perfectly fine. How can I solve this problem?

To add, I want to ask whether there is a way to upgrade R, since version 2.15.2 doesn't seem to be compatible for most of the packages I want to work with.

I'm currently using Linux version 3.6.11-1 RedHat 4.7.2-2 fedora linux 17.0 x86-64.

I checked the CRAN website but they seemed to have the most unupdated versions of R (if that is even possible) that dates all the way back to '09. I would seriously love to update myself from this old version of R. Any advice on this too?

Answer

sgibb picture sgibb · Apr 22, 2014

install_github is a function of the devtools package. You have to install and load devtools before using install_github:

install.packages("devtools")
library("devtools")
install_github("youruser/yourrepo")