Skip to content

General Issue: Investigate the topic of metadata for pdf in R #15

@Polkas

Description

@Polkas

Background Information

We want to investigate whether we can, with low cost and minimal dependencies, provide metadata support for our PDFs. All cells are saved as pdf metadata.

A hack with a title as a JSON

library(jsonlite)

# 1. Create a list of your custom metadata
my_metadata <- list(
    title = "Alpha",
    header1 = 42,
    status = "Draft",
    tags = c("R", "Plot", "JSON")
)

# 2. Convert to a JSON string - we should use base R for that - we control what we convert
json_string <- toJSON(my_metadata, auto_unbox = TRUE)

# 3. Pass the JSON string to the title argument
pdf("json_metadata_plot.png", title = json_string)
plot(1:10, main = "Data Visualization")
dev.off()

Using a system library
https://stackoverflow.com/a/24254259/5442527

Definition of Done

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions