Skip to contents

Add and modify (set_*) or retrieve (get_*) presentation metadata for a procr_table object. Metadata includes titles, subtitles, stub head labels, and footer notes that are used when displaying or exporting the table.

Usage

set_metadata(tab, ..., title, subtitle, stubhead, footer)

get_metadata(tab, slot = NULL)

Arguments

tab

A procr_table object.

...

Not used for values, forces later arguments to bind by name.

title

Character scalar, NULL, or missing. Main title displayed above the table. If missing (default), existing value is preserved. If NULL, removes the title. If a character string, sets the title to that value.

subtitle

Character scalar, NULL, or missing. Subtitle displayed below the title. Follows same logic as title.

stubhead

Character scalar, NULL, or missing. Label for the row header area (the top-left cell of the table). Follows same logic as title.

Character vector, NULL, or missing. Footer text displayed below the table, typically used for notes, sources, or disclaimers. Multiple elements are placed in multiple rows. Follows same logic as title.

slot

One of the abovementioned metadata slots if a specific one should be extracted or NULL (default) to retrieve all metadata as a list.

Value

set_* returns the modified procr_table object with updated metadata. Existing metadata values are preserved unless explicitly overwritten. get_* returns the specified metadata slot or all metadata as a list.

Examples

if (FALSE) { # \dontrun{
  # Add metadata
  tab <- set_metadata(tab, title = "My Title", footer = "Source: EU-SILC")
  get_metadata(tab, "title")
  # Remove the subtitle
  tab <- set_metadata(tab, subtitle = NULL)
} # }