Description Usage Arguments Details Value Examples
Download item remote content
1 |
name |
Name of the existing item that will be updated. |
replace |
If TRUE, existing item's object is overwritten. |
Repo index files can be used as pointers to remote data. The pull function will download the actual data from the Internet, including regular items or attachment. Another use of the URL item's parameter is to attach a remote resource without downloading it.
Used for side effects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Repository creation
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)
remote_URL <- paste0("https://github.com/franapoli/repo/blob/",
"untested/inst/remote_sample.RDS?raw=true")
## The following item will have remote source
rp$put("Local content", "item1", "Sample item 1", "tag",
URL = remote_URL)
print(rp$get("item1"))
## suppressWarnings(try(rp$pull("item1"), TRUE))
tryCatch(rp$pull("item1"),
error = function(e)
message("There were warnings whle accessing remote content"),
warning = function(w)
message("Could not download remote content")
)
print(rp$get("item1"))
## 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.