stickr_get: Get hex sticker from web

Description Usage Arguments Details Value Examples

View source: R/funs.R

Description

This function tries to search for the sticker for the package you want.

Usage

1
2
3
4
5
6
7
8
stickr_get(
  name,
  destfile = NULL,
  view = TRUE,
  filename = NULL,
  path = NULL,
  repo = NULL
)

Arguments

name

name of sticker, character of length 1

destfile

destination, defaults to NULL

view

show sticker after loading? Defaults to TRUE

filename

filename of sticker in repository, use if auto-detection fails

path

path within repository, use if auto-detection fails

repo

repository name, use if auto-detection fails

Details

It will automatically get stickers for any packages in the rstudio/hex-stickers repository or if the package's GitHub repository is specified in the DESCRIPTION and the man/figures directory contains (1) exactly one file or (2) a file named logo.png. These cases cover most CRAN packages.

For packages where the sticker cannot be automatically found or defaults must be overridden, the repository, path, and filename arguments provide escape hatches.

Packages stored somewhere other than GitHub are currently unsupported.

If you hit rate limits on GitHub API calls, consider setting the GITHUB_PAT environment variable. See gh::gh() for details.

Value

path to downloaded image

Examples

1
2
3
4
5
6
# Get a sticker
if(interactive()) r6 <- stickr_get("R6")
# Get a sticker in svg
if(interactive()) r6 <- stickr_get("R6", filename = "R6.svg")
# Get a particular sticker in the man/figures folder
if(interactive()) tm <- stickr_get("textmineR", filename = "textmineR_v8.png")

akgold/stickr documentation built on Oct. 28, 2020, 5:59 a.m.