Title: | A Helpful Way to Install R Packages Hosted on GitHub |
---|---|
Description: | Provides an helpful way to install packages hosted on GitHub. |
Authors: | Koji Makiyama [cre, aut], Atsushi Hayakawa [ctb], Shinya Uryu [ctb], Hiroaki Yutani [ctb], Nagi Teramo [ctb], Kazuhiro Maeda [ctb] |
Maintainer: | Koji Makiyama <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.2 |
Built: | 2024-11-17 03:55:12 UTC |
Source: | https://github.com/hoxo-m/githubinstall |
Install Packages from GitHub
gh_install_packages(packages, ask = TRUE, ref = "master", build_vignettes = FALSE, dependencies = NA, verbose = TRUE, quiet = !verbose, lib = NULL, ...) githubinstall(packages, ask = TRUE, ref = "master", build_vignettes = FALSE, dependencies = NA, verbose = TRUE, quiet = !verbose, lib = NULL, ...)
gh_install_packages(packages, ask = TRUE, ref = "master", build_vignettes = FALSE, dependencies = NA, verbose = TRUE, quiet = !verbose, lib = NULL, ...) githubinstall(packages, ask = TRUE, ref = "master", build_vignettes = FALSE, dependencies = NA, verbose = TRUE, quiet = !verbose, lib = NULL, ...)
packages |
character vector of the names of the packages.
You can specify |
ask |
logical. Indicates ask to confirm before install. |
ref |
character vector. Desired git reference.
Could be a commit, tag, or branch name, or a call to |
build_vignettes |
logical. If |
dependencies |
logical. Indicating to also install uninstalled packages which the packages depends on/links to/suggests.
See argument dependencies of |
verbose |
logical. Indicating to print details of package building and installation. Dfault is |
quiet |
logical. Not |
lib |
character vector giving the library directories where to install the packages.
Recycled as needed. Defaults to the first element of |
... |
additional arguments to control installation of package, passed to |
githubinstall()
is an alias of gh_install_packages()
.
TRUE if success.
## Not run: gh_install_packages("AnomalyDetection") githubinstall("AnomalyDetection") ## End(Not run)
## Not run: gh_install_packages("AnomalyDetection") githubinstall("AnomalyDetection") ## End(Not run)
Get Information of Packages on GitHub
gh_list_packages(username = NULL)
gh_list_packages(username = NULL)
username |
a character vector as GitHub username. If you set |
a data.frame that has author, package name and title.
## Not run: gh_list_packages("hadley") ## End(Not run)
## Not run: gh_list_packages("hadley") ## End(Not run)
Search Packages from Titles by Regular Expressions
gh_search_packages(regex, ignore.case = TRUE)
gh_search_packages(regex, ignore.case = TRUE)
regex |
a character string containing a regular expression to be matched in the package titles. |
ignore.case |
logical. If |
a data.frame of package information.
## Not run: gh_search_packages("lasso") ## End(Not run)
## Not run: gh_search_packages("lasso") ## End(Not run)
Find source code for functions in packages on GitHub
gh_show_source(func, repo = NULL, browser = getOption("browser"))
gh_show_source(func, repo = NULL, browser = getOption("browser"))
func |
a function or a character string. A function name. |
repo |
a character string. A GitHub repository name that must not be exactry. |
browser |
a character string giving the name of the program to be used as the HTML browser. |
## Not run: gh_show_source("mutate", "dplyr") library(dplyr) gh_show_source(mutate) ## End(Not run)
## Not run: gh_show_source("mutate", "dplyr") library(dplyr) gh_show_source(mutate) ## End(Not run)
Suggest Github Repository from a Incomplete Name
gh_suggest(repo_name, keep_title = FALSE)
gh_suggest(repo_name, keep_title = FALSE)
repo_name |
a character. A part of a repository name. |
keep_title |
logical. Indicates to keep the package titles as an attrbite. Default |
candidates for the repository name.
gh_suggest("AnomalyDetection") # [1] "twitter/AnomalyDetection" gh_suggest("BnomalyDetection") # [1] "twitter/AnomalyDetection" gh_suggest("uwitter/BnomalyDetection") # [1] "twitter/AnomalyDetection"
gh_suggest("AnomalyDetection") # [1] "twitter/AnomalyDetection" gh_suggest("BnomalyDetection") # [1] "twitter/AnomalyDetection" gh_suggest("uwitter/BnomalyDetection") # [1] "twitter/AnomalyDetection"
Suggest Github Username from a Faint Memory
gh_suggest_username(vague_name)
gh_suggest_username(vague_name)
vague_name |
a character. GitHub username that may not be exact. |
The trouble is that the usernames of GitHub are often hard to remember. The function provides a way to obtain usernames from a faint memory.
a character vector of the closest usernames to input.
## Not run: gh_guess_username("yuhui") # [1] "yihui" ## End(Not run)
## Not run: gh_guess_username("yuhui") # [1] "yihui" ## End(Not run)
Update the List of Packages on GitHub.
gh_update_package_list()
gh_update_package_list()
The default "dependencies" is NA that means c("Depends", "Imports", "LinkingTo"). If "build_vignettes" is TRUE, the install needs "Suggests" dependency in many cases. So we recommend in such case to set "dependencies" to TRUE that means c("Depends", "Imports", "LinkingTo", "Suggests").
recommend_dependencies(ask, build_vignettes, dependencies, quiet)
recommend_dependencies(ask, build_vignettes, dependencies, quiet)
ask |
logical. Indicates ask to confirm before install. |
build_vignettes |
logical. If |
dependencies |
logical. Indicating to also install uninstalled packages which the packages depends on/links to/suggests.
See argument dependencies of |
quiet |
logical. Not |
If "quiet" is TRUE, we overwrite all packages forcibly and silently. Else if "quiet" is FALSE and "ask" is TRUE, we ask whether to overwrite it. (Default) Else if "quiet" is FALSE and "ask" is FALSE, we message to overwrite it and do it.
remove_conflict_repos(repos, lib, quiet, ask)
remove_conflict_repos(repos, lib, quiet, ask)
repos |
charactor vector of full GitHub repository names. |
lib |
character vector or NULL. |
quiet |
logical. |
ask |
logical. |
Suggest candidates from "package_name" and make user selected one of them.
select_repository(package_name)
select_repository(package_name)
package_name |
a character string. A package name or full GitHub repository name. |
candidate with title
The "repo" argument allows to contain "ref" as "package_name@ref", "package_name#pull" or "package_name[branch]". The function detects that "repo" contains "ref" and separates into pure repo and ref. If "repo" contains "ref" and "ref" argument is specified, the values in "repo" take precedence.
separate_into_package_and_reference(packages, original_ref)
separate_into_package_and_reference(packages, original_ref)
packages |
"repo" argument. |
original_ref |
"ref" argument. |