Description Usage Arguments Value Examples
These functions read a file from a commit in a repository.
read_github_file()
reads a text file, using readr::read_file()
, and
returns the result as a string. read_github_lines()
reads a text file,
using readr::read_lines()
, and returns the result as a character vector,
one element per line. read_github_csv()
reads a CSV file, using
readr::read_csv()
, and returns the result as a tibble.
1 2 3 4 5 | read_github_file(path, ref, repo, ...)
read_github_lines(path, ref, repo, ...)
read_github_csv(path, ref, repo, ...)
|
path |
(string) The path to the file, within the repository. |
ref |
(string) Either a SHA, branch or tag used to identify the commit. |
repo |
(string) The repository specified in the format: |
... |
Parameters passed to |
read_github_file()
returns a string containing the file contents,
read_github_lines()
returns a character vector, and read_github_csv()
returns a tibble.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
read_github_file(
path = "README.md",
ref = "main",
repo = "ChadGoymer/githapi"
)
read_github_lines(
path = "README.md",
ref = "main",
repo = "ChadGoymer/githapi"
)
read_github_csv(
path = "inst/test-data/test.csv",
ref = "main",
repo = "ChadGoymer/githapi"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.