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. If the package is one with a sticker in the rstudio/hex-stickers repository, it will come from there. If you want SVG rather than PNG, specify a filename.

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

If not, this function attempts to get the package's GitHub repository from the package description, and look for the sticker in the man/figures directory.

In case this function cannot find the sticker, escape hatches are provided for specifying the repository, path within the repository, and filename of the sticker you want.

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")

stickr documentation built on July 8, 2020, 5:12 p.m.