Skip to content

Instantly share code, notes, and snippets.

@k-hench
Created May 3, 2021 11:14
Show Gist options
  • Save k-hench/7e8d8e1ee23ab4b4dc293acd08305893 to your computer and use it in GitHub Desktop.
Save k-hench/7e8d8e1ee23ab4b4dc293acd08305893 to your computer and use it in GitHub Desktop.
small demo of how to use exiftoolr to add plot metadata
# remotes::install_github("JoshOBrien/exiftoolr")
library(exiftoolr)
library(tidyverse)
ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point()
ggsave("test.pdf")
ggsave("test.png")
message <- "created using the Rscript 'r_exiftool.R' by Kosmas Hench"
exif_call(args = str_c("-Description=",message), path = "test.png")
exif_call(args = str_c("-Description=",message), path = "test.pdf")
exif_read("test.pdf")$Description
exif_read("test.png")$Description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment