View source: R/read_file_from_repo.R
read_file_from_repo | R Documentation |
read_file_from_repo
reads a file from a GitHub repository. Both public
and personal repositories are supported.
read_file_from_repo( repo, path, token_key, user = "rethinkpriorities", private = FALSE )
repo |
A character string specifying the GitHub repository. |
path |
A character string specifying the file path in the GitHub repository. |
token_key |
A character string specifying the key to the GitHub personal
access token (PAT), stored using the |
user |
A character string specifying the GitHub user name. By default this is 'rethinkpriorities'. |
private |
A boolean value indicating whether the GitHub repository is a private repository or not. The default is FALSE. |
This function relies on the keyring
package to retrieve a stored
GitHub Personal Access Token (PAT) to access private repositories. This is
safer than storing the PAT in the environment.
## Not run: data <- read_file_from_repo( repo = "ea-data", path = "data/edited_data/sexual_orientation.csv", private = TRUE, token_key = "github-PAT" ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.