cfgo_badge: Use lifecycle badges in your documentation

Description Usage Arguments Details How to use in function documentation Examples

View source: R/cfgo_badge.R

Description

Use badges in your function documentation to explain the current status of the function.You can choose between four different badges: "experimental", "questioning ", "stable" and "deprecated". When to use which one while following the cfgo style is here explained https://style.cfgo.de/lifecycle.

Usage

1
cfgo_badge(stage)

Arguments

stage

choose one of "experimental", "questioning ", "stable" and "deprecated".

Details

Before you can use 'cfgo_badge' in your source package you have to run 'usethis::use_lifecycle()' in the console. This will create the directory 'figures/' in 'man/'. 'figures' containes badge images in form of '.svg' files. Then you can create badges in your functions. If you want to add for example the badge "questioning" in your documentation, just copy and paste

'\Sexpr[results=rd, stage=render]assistant::cfgo_badge("questioning")'

into your documentation. To check if it works, you have to rebuild your source package (Ctrl+Shit+B). For the other badge options just replace 'questioning' in the code.

How to use in function documentation

1. run 'usethis::use_lifecycle()'
2. Use the following script for the badges:

#' Title
#'
#' Here ist the discription
#' \Sexpr[results=rd, stage=render]assistant::cfgo_badge("questioning")
#'
#' @param variables
#'
#' @return
#' @export
#'
#' @section Questioning:
#' Please describe briefly the questioned part. For more detailed information refer to the github issue.
#'
my_function <- function(variables) {

}

Examples

1
2
3
4
assistant::cfgo_badge("questioning")
assistant::cfgo_badge("experimental")
assistant::cfgo_badge("stable")
assistant::cfgo_badge("deprecated")

cfgo/assistant documentation built on Aug. 7, 2020, 8:04 p.m.