Extract GitHub user and repo name from GitHub URL

githubURLParts(urls)

Arguments

urls

A character() vector of URLs

Value

A data.frame with four columns:

  • urlThe original GitHub URL

  • user_repoThe GitHub "username/repo", combined

  • userThe GitHub username

  • repoThe GitHub repo name

Examples

# find GitHub URL details for
# Bioconductor packages
bpkgl = biocPkgList()
#> 'getOption("repos")' replaces Bioconductor standard repositories, see
#> 'help("repositories", package = "BiocManager")' for details.
#> Replacement repositories:
#>     CRAN: https://cloud.r-project.org
urldetails = githubURLParts(bpkgl$URL)
urldetails = urldetails[!is.na(urldetails$url),]
head(urldetails)
#>                                              url                  user_repo
#> 8          https://github.com/malhamdoosh/abseqR         malhamdoosh/abseqR
#> 11              https://github.com/tgac-vumc/ACE              tgac-vumc/ACE
#> 14            https://github.com/rdiaz02/adacgh2            rdiaz02/adacgh2
#> 21 https://github.com/HenrikBengtsson/affxparser HenrikBengtsson/affxparser
#> 27           https://github.com/bmbolstad/affyio           bmbolstad/affyio
#> 29          https://github.com/bmbolstad/affyPLM          bmbolstad/affyPLM
#>               user       repo
#> 8      malhamdoosh     abseqR
#> 11       tgac-vumc        ACE
#> 14         rdiaz02    adacgh2
#> 21 HenrikBengtsson affxparser
#> 27       bmbolstad     affyio
#> 29       bmbolstad    affyPLM