Description Usage Arguments Details How to use in function documentation Examples
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.
1 | cfgo_badge(stage)
|
stage |
choose one of "experimental", "questioning ", "stable" and "deprecated". |
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.
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) {
}
1 2 3 4 | assistant::cfgo_badge("questioning")
assistant::cfgo_badge("experimental")
assistant::cfgo_badge("stable")
assistant::cfgo_badge("deprecated")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.