# NOT RUN {
## Repository creation
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)
## Creating a PDF file with a figure.
pdffile <- file.path(rp_path, "afigure.pdf")
pdf(pdffile)
plot(runif(30), runif(30))
dev.off()
## Attaching the PDF file to the repo
rp$attach(pdffile, "A plot of random numbers", "repo_sys")
## don't need the original PDF file anymore
file.remove(pdffile)
## Opening the stored PDF with Evince document viewer
# }
# NOT RUN {
rp$sys("afigure.pdf", "evince")
# }
# NOT RUN {
## wiping temporary repo
unlink(rp_path, TRUE)
# }
Run the code above in your browser using DataLab