available icon indicating copy to clipboard operation
available copied to clipboard

How do you determine which GitHub package uses name

Open muschellij2 opened this issue 5 years ago • 4 comments

I love the package, but find it hard to find which overlaps exist. For example, I wanted to make sure the name adept wasn't taken, and I searched and found it on GitHub (it's the package I was working on). But to find the link to the GitHub, I needed to know which slot github was. Is there an accessor function or should I send a PR with named list elements for output of available?

res = available::available("adept", browse = FALSE)
#> Warning: 'BiocInstaller' and 'biocLite()' are deprecated, use the 'BiocManager'
#>   CRAN package instead.
res[[4]]
#> Available on GitHub:  ✖
names(res)
#> NULL
slotNames(res)
#> character(0)
names(res[[4]])
#> [1] "available" "close"
unlist(res[[4]])
#>                                    available 
#>                                      "FALSE" 
#>                               close.pkg_name 
#>                                      "adept" 
#>                                  close.title 
#> "Adaptive Empirical Pattern Transformation " 
#>                                    close.url 
#>       "https://github.com/martakarass/adept" 
#>                           close.pkg_location 
#>                          "martakarass/adept" 
#>                                close.pkg_org 
#>                                "martakarass" 
#>                               close.distance 
#>                                          "0"

Created on 2019-02-28 by the reprex package (v0.2.1)

muschellij2 avatar Feb 28 '19 20:02 muschellij2

It uses an API that crawls GitHub https://github.com/ropenscilabs/available/blob/57c04c32f14ade8eb72b568a434dbbe36c3c9365/R/github.R#L32

http://rpkg.gepuro.net / http://rpkg-api.gepuro.net

I don't know what heuristics it uses, likely just GItHub's repository types, so your package will likely be added to the list at some point soon.

jimhester avatar Feb 28 '19 21:02 jimhester

Sorry if I wasn't clear - how do you extract which repo it found on GitHub from the object returned from available::available in R? Can you extract elements from the output list object/available_query object?

muschellij2 avatar Feb 28 '19 21:02 muschellij2

I guess we could have a github_locations() function to pull this out, or possibly the default print method should just print the first few found by default.

jimhester avatar Mar 01 '19 13:03 jimhester

You could say the number of github matches next to the cross? Would you like someone to work on a github_locations() function to print this out? I'm available (no pun intended).

trickytank avatar Sep 04 '22 07:09 trickytank