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.
Usage
read_private_file(
path,
use_cache = TRUE,
auth_token = pal::pkg_config_val("token_repo_private")
)
Arguments
- 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
FALSE
, the file is always newly fetched.- auth_token
Personal access token of a gitlab.com account with access to the private FOKUS repository.
Value
The file content, as character scalar for text files, otherwise as a raw vector.
Details
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.
See also
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()