use_badges: Use badges

View source: R/use_badges.R

use_badgesR Documentation

Use badges

Description

Create one or more badges showing the status of your R package. Uses the package badger.

Usage

use_badges(
  ref = NULL,
  add_hex = TRUE,
  add_actions = "rworkflows",
  add_doi = NULL,
  add_lifecycle = FALSE,
  add_github_version = TRUE,
  add_commit = TRUE,
  add_code_size = TRUE,
  add_license = TRUE,
  add_authors = TRUE,
  add_codecov = TRUE,
  add_codecov_graphs = "icicle",
  add_bioc_release = FALSE,
  add_bioc_download_month = FALSE,
  add_bioc_download_total = FALSE,
  add_bioc_download_rank = FALSE,
  add_cran_release = FALSE,
  add_cran_checks = FALSE,
  add_cran_download_month = FALSE,
  add_cran_download_total = FALSE,
  branch = "master",
  as_list = FALSE,
  sep = "\n",
  hex_height = 300,
  codecov_graph_width = 200,
  colors = list(github = "black", bioc = "green", cran = "black", default = "blue",
    lifecycle = NULL),
  verbose = TRUE
)

Arguments

ref

Reference for a GitHub repository. If NULL (the default), the reference is determined by the URL field in the DESCRIPTION file.

add_hex

Add a hex sticker. If add_hex=TRUE, will assume the sticker is located at the following relative path: "inst/hex/hex.png". If add_hex is a character string, this will instead be used as the relative hex path (e.g. "/images/mysticker.png").

add_actions

The name of one or more GitHub Actions to show the status for with badge_github_actions (e.g. c("rworkflows","rworkflows_static")).

add_doi

Add the DOI of a given package or publication associated with the package using badge_doi. Must be provided as a character string, e.g.: "10.1111/2041-210X.12628"

add_lifecycle

Add package lifecycle stage. If not FALSE, must be a character string indicating one of the following valid lifecycle stage:

  • "stable"

  • "deprecated"

  • "superseded"

  • "experimental"

See lifecycle.r-lib.org for further details.

add_github_version

Add package version with badge_github_version.

add_commit

Add the last GitHub repo commit date with badge_last_commit.

add_code_size

Add code size with badge_code_size.

add_license

Add license info with badge_license.

add_authors

Add author names inferred from the DESCRIPTION file.

add_codecov

Add Codecov status with badge_codecov. See the Codecov site for more information about these badges.

add_codecov_graphs

Add Codecov graphs visualising results of code coverage tests. Options include:

  • "sunburst"

  • "tree"

  • "icicle"

See the Codecov site for more information about each plot type.

add_bioc_release

Add Bioc release version with badge_bioc_release.

add_bioc_download_month

Add the number of Bioc downloads last month badge_bioc_download.

add_bioc_download_total

Add the number of Bioc downloads total badge_bioc_download.

add_bioc_download_rank

Add the download rank of the package on Bioc badge_bioc_download_rank.

add_cran_release

Add Bioc release version with badge_cran_release.

add_cran_checks

Add whether package is passing all checks on CRAN with badge_cran_checks.

add_cran_download_month

Add the number of CRAN downloads last month badge_cran_download.

add_cran_download_total

Add the number of CRAN downloads total badge_cran_download.

branch

Name of the GitHub repository branch to use.

as_list

Return the header as a named list (TRUE), or a collapsed text string (default: FALSE).

sep

Character to separate each item in the list with using paste.

hex_height

Height of the hex sticker in pixels (when add_hex=TRUE).

codecov_graph_width

Width of each Codecov graph in pixels (when add_codecov_graph!=FALSE).

colors

Colors to assign to each group of badges (when possible).

verbose

Print messages.

Value

A named list of selected badges in markdown format.

Examples

badges <- rworkflows::use_badges(ref = "neurogenomics/rworkflows") 

rworkflows documentation built on Nov. 2, 2023, 5:21 p.m.