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