Skip to contents

[Experimental]

The Kenya National Data Archive gates every download behind an account, and this package does not automate sign-in, licence acceptance or approval workflows, so the function reports what is required and stops.

Usage

knbs_download_microdata(
  survey,
  files = NULL,
  destination,
  overwrite = FALSE,
  verify = TRUE,
  manifest = TRUE,
  quiet = FALSE
)

Arguments

survey

A study identifier.

files

Files to download.

destination

Directory to write to. Unused: nothing is downloaded.

overwrite

Whether to overwrite existing files.

verify

Whether to verify downloads.

manifest

Whether to write a download manifest.

quiet

Whether to suppress progress messages.

Value

Never returns; raises knbs_error_authentication_required.

Details

It exists so that the refusal is explicit and points at the official process, rather than the operation appearing to be unsupported by oversight.

Microdata that their producers publish for anyone are another matter: the FinAccess household and MSE Tracker surveys are listed by knbs_finaccess_files() and downloaded by knbs_download_finaccess(). Files obtained through the archive's own process can be read with knbs_read_microdata().

See also

knbs_survey_files() to see what a study holds and on what terms; knbs_finaccess_files() for open microdata.

Examples

# Raises an error explaining the official access process; contacts nothing.
try(knbs_download_microdata("KEN-KNBS-KIHBS-2015-2016-v01"))
#> Error in knbs_download_microdata("KEN-KNBS-KIHBS-2015-2016-v01") : 
#>   Microdata from "kenada" cannot be downloaded programmatically.
#> ✖ Every download requires an account with the archive.
#> ℹ Register and request access at
#>   <https://statistics.knbs.or.ke/nada/index.php/home>.
#> ℹ knbsdata does not automate sign-in, licence acceptance or approval workflows.
#> ℹ Use `knbs_survey_files()` to see what the study holds and on what terms.
#> ℹ Open microdata, the FinAccess surveys, are listed by
#>   `knbs_finaccess_files()`.