R/require-github.r

Defines functions require_github

require_github <- function(src) {
    require(devtools)

    #break the github path and extract the package name
    pkg = tail(strsplit(src, '/')[[1]], 1)

    #If the package isnt loaded then import it from github:
    if (!paste('package:', pkg, sep='') %in% search()) {
        install_github(src)
    }
}
wrbrooks/brooks documentation built on June 30, 2023, 8:38 a.m.