Description Usage Details Value Examples
Creates a list of functions, each one associated with a repository item, that can be used to access items directly.
1 |
Repository handlers are functions associated with
items. As opposed to item names, they can take advantage of IDE
auto-completion features and do not require quotation marks. A
handler to the repo
object itself is provided in the
list.
A list of functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Repository creation
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)
## Putting some irrelevant data
rp$put(1, "item1", "Sample item 1", "repo_handlers")
rp$put(2, "item2", "Sample item 2", "repo_handlers")
## Getting item handlers
h <- rp$handlers()
## handlers have the same names as the items in the repo (and they
## include an handler to the repo itself).
names(h)
## Without arguments, function "item1" loads item named "item1".
i1 <- h$item1()
## Arguments can be used to call other repo functions on the item.
h$item1("info")
## After putting new data, the handlers must be refreshed.
rp$put(3, "item3", "Sample item 3", "repo_handlers")
h <- rp$handlers()
names(h)
## 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.