Skip to contents

Extracts the value(s) belonging to the tag_names documenting obj_name from a list of roxy_block objects.

Usage

roxy_tag_value(blocks, obj_name, tag_names, param_name)

Arguments

blocks

A list of roxy_block objects as returned by roxy_blocks().

obj_name

Object name to extract, usually a function name. A character scalar.

tag_names

Name(s) of the roxygen2 tag(s) (without the @ prefix) to extract the value(s) from. A character vector.

param_name

Parameter name to extract the value from. Only relevant if "param" %in% tag_names. A character scalar.

Value

A character vector of the same length as tag_names.

See also

Other package documentation functions: enum_fn_param_defaults(), fn_param_defaults(), roxy_blocks(), roxy_obj(), roxy_to_md_links()

Examples

if (interactive()) {
  try(
    pal::roxy_blocks(pkg = "viridisLite") |>
      pal::roxy_tag_value(obj_name = "viridis",
                          tag_names = "param",
                          param_name = "alpha") |>
      cat()
  )
}