read_private_file | R Documentation |
Downloads a file from the private FOKUS repository and returns it as a character scalar in case of a text file, or a raw vector otherwise.
read_private_file(
path,
use_cache = TRUE,
auth_token = pal::pkg_config_val("token_repo_private")
)
path |
File path relative to the repository root. |
use_cache |
Whether or not to return cached results if possible. Caching is done based on file content hashing, so the file is only newly fetched if it
actually changed since the last download. If |
auth_token |
Personal access token of a gitlab.com account with access to the private FOKUS repository. |
Files are downloaded via GitLab's RESTful API (v4). If use_cache = TRUE
(the default), a downloaded file is cached
on disk in this package's user-cache pins board and only newly fetched from the private FOKUS repository GitLab remote if is has changed
since being downloaded the last time. Caching saves a bit of time and (potentially) a lot of bandwidth.
The file content, as character scalar for text files, otherwise as a raw vector.
Other data import functions:
read_easyvote_municipalities()
,
read_online_participation_codes()
,
read_survey_data()
,
read_voting_register_data_extra()
,
read_voting_register_ids()
,
tidy_cols()
Other private FOKUS repository functions:
print_private_repo_structure()
,
url_repo_private()
,
write_private_file()
# GitLab PAT with access to the private FOKUS repository is required for this function to work
try(
fokus::read_private_file("raw/survey_data_2018-09-23_aargau.xlsx") |>
length()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.