Description Usage Arguments Value Examples
Create a new item from an existing file.
1 2 3 4 5 6 7 8 9 10 11 |
filepath |
The path to the file to be stored in the repo. |
description |
A character description of the item. |
tags |
A list of tags to sort the item. Tags are useful for selecting sets of items and run bulk actions. |
prj |
The name of a |
src |
The name of the item that produced the stored object. Usually a previously attached source code file. |
chunk |
The name of the code chunk within |
replace |
If the item exists, overwrite the specified fields. |
to |
An existing item name to attach the file to. |
URL |
A URL where the item contents con be downloaded from. |
Used for side effects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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")
## End(Not run)
## wiping temporary repo
unlink(rp_path, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.