Get the package name from a GitHub repo/package@branch string

ghPkgName(x)

Arguments

x

character vector of package names

Value

a named character vector

Examples

pkgs <- c("dplyr", "PredictiveEcology/pemisc", "PredictiveEcology/SpaDES.core@development")
ghPkgName(pkgs) ## "dplyr" "pemisc" "SpaDES.core"
#>                                     dplyr 
#>                                   "dplyr" 
#>                  PredictiveEcology/pemisc 
#>                                  "pemisc" 
#> PredictiveEcology/SpaDES.core@development 
#>                             "SpaDES.core"