Scavenge the web for possible hex logos for CRAN packages.
installation
1 - Install the package:
# Most recent development version from github:
devtools::install_github('pedrocoutinhosilva/hexFinder')
Usage
Call the find_hex()
function with the name of the package you would like to find a hex logo for, and optionally, a place where the logo will be stored:
> find_hex("ggplot2", "output")
for ggplot2
Downloaded from GitHub repo hex 1] "output/ggplot2.png" [
When a package is not on CRAN, or a logo for the package cannot be found, a simple logo will be generated:
> find_hex("notapackage", "output")
Not a cran packagefor notapackage
No logo found, generated hex 1] "output/notapackage.svg" [
As an alternative, you can also use the scavenge()
function. It is functionality the same as find_hex()
, but with extra raccoons:
> scavenge("rlang", "output")
Summoning racoons to help with the search.../\ /\
-'<o_o>'- _
'_\
() ()\ , ( . ) )/._./
(_)-(_).--'
for rlang
Downloaded from GitHub repo hex 1] "output/rlang.png" [
Dealing with github API limits
The Github API used by this package does have some limits. The first time in a session that you make a search you might see the following message:
> find_hex("devtools", "output")
No github personal access token provided.for github will apply.
Limited search rates if you plan to query multiple repos in a short time
Set up github_pat global variable for devtools
Downloaded from GitHub repo hex 1] "output/devtools.svg" [
This limit is normally not a problem (Its around 50 requests per hour), but if you are planning to do a large amount of searches, you can set up a github_pat
global variable using a .Renviron file or calling Sys.setenv()
:
Sys.setenv(github_pat = "your_personal_access_token")
More information on how to get a github personal access token, at https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.
Documentation
Online documentation is available at: https://www.anatomyofcode.com/hexFinder