
Function to add metadata tags to figures and tables
f.metadata.tag.RdAdd metadata tags to figures and tables. These include the download date of the dataset.
The function will return an error if both raw_data and time_tag parameters are NULL.
Arguments
- object
ggplotorflextableThe figure or table to add metadata to.- raw_data
listoutputs ofget_all_polio_data()orextract_country_data().- time_tag
strA date and time string. Defaults toraw.data$metadata$download_time.
Examples
if (FALSE) { # \dontrun{
raw.data <- get_all_polio_data(attach.spatial.data = FALSE)
df <- datasets::iris
p1 <- ggplot2::ggplot() +
ggplot2::geom_col(data = df, ggplot2::aes(x = Sepal.Length, y = Sepal.Width))
p2 <- f.metadata.tag(p1, raw.data) # use raw.data download time
p3 <- f.metadata.tag(p1, time_tag = "2021-01-01") # use custom time tag
} # }