Description Usage Arguments Value Examples
List directories, html-URLs and download-URLs in a GitHub directory.
1 2 3 4 5 6 7 |
path |
A string formatted as "owner/repo/subdir" or "owner/repo/subdir@branch", e.g.: "maurolepore/ghr/reference@gh-pages". |
... |
Arguments passed to |
regexp |
A regular expression (e.g. |
ignore.case |
if |
invert |
logical. If |
A character string.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | path <- "maurolepore/tor/inst/extdata/mixed"
# The first call make the request
system.time(ghr_ls(path))
# Takes no time because the first call is memoised
system.time(ghr_ls(path))
ghr_ls(path, regexp = "[.]csv$")
ghr_ls(path, regexp = "[.]csv$", invert = TRUE)
ghr_ls(path, regexp = "[.]RDATA$", invert = TRUE, ignore.case = FALSE)
ghr_ls(path, regexp = "[.]RDATA$", invert = TRUE, ignore.case = TRUE)
# ghr_ls_download_url() and ghr_ls_html_url are similar
(d_url <- ghr_ls_download_url(path, regexp = "[.]csv$")[[1]])
read.csv(d_url)
(h_url <- ghr_ls_html_url(path, regexp = "[.]csv$")[[1]])
if (interactive()) {
utils::browseURL(h_url)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.