Learn R Programming

zephyr (version 0.1.2)

list_options: List package options

Description

List all zephyr_options specified in a package. Either as an list or as as character vector formatted for use in your package documentation.

To document your options use use_zephyr() to set everything up, and edit the created template as necessary.

Usage

list_options(
  as = c("list", "params", "markdown"),
  .envir = sys.function(which = -1)
)

Value

list or character depending on as

Arguments

as

[character(1)] Format in which to return the options:

  • "list": Return a nested list, where each top level element is a list with the specification of an option.

  • "params": Return a character vector with the "@param" tag entries for each option similar to how function parameters are documented with roxygen2.

  • "markdown": Return a character string with markdown formatted entries for each option.

.envir

Environment in which the options are defined. Default is suitable for use inside your package.

Examples

Run this code
# List all options in zephyr
x <- list_options(.envir = "zephyr")
print(x)
str(x)

# Create @params tag entries for each option
list_options(as = "params", .envir = "zephyr") |>
  cat()

# List options in markdown format
list_options(as = "markdown", .envir = "zephyr") |>
  cat()

Run the code above in your browser using DataLab