Package: knbsdata 0.5.0

Mustapha Wasseja Mohammed

knbsdata: Discover, Retrieve and Cite Official Kenyan Statistics

Provides a consistent interface for discovering and retrieving official data and statistical products of the Kenya National Bureau of Statistics (KNBS): its survey archive <https://statistics.knbs.or.ke/nada/>, publications library, census, consumer price and economic data portals <https://opendata.knbs.or.ke/beta/databrowser/>, the open FinAccess survey microdata <https://finaccess.knbs.or.ke/>, and the Kenya Demographic and Health Survey indicators published through the DHS Program API <https://api.dhsprogram.com/>. Standardises them into documented schemas, preserves provenance metadata such as release dates and checksums, and generates reproducible citations. This is an independent open-source project and is not an official KNBS product.

Authors:Mustapha Wasseja Mohammed [aut, cre], Pascal Ochieng Owiti [aut]

knbsdata_0.5.0.tar.gz
knbsdata_0.5.0.zip(r-4.7-any)knbsdata_0.5.0.zip(r-4.6-any)
knbsdata_0.5.0.tar.gz(r-4.7-any)knbsdata_0.5.0.tar.gz(r-4.6-any)
knbsdata_0.5.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
knbsdata/json (API)

# Install 'knbsdata' in R:
install.packages('knbsdata', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/mustapha-wasseja/knbsdata/issues

Pkgdown/docs site:https://mustapha-wasseja.github.io

On CRAN:

Conda:

3.48 score 32 exports 28 dependencies

Last updated from:fc46040ca8. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK145
source / vignettesOK235
linux-releaseOK163
windows-develOK141
windows-releaseOK107
wasm-releaseOK109

Exports:knbs_abstract_tableknbs_abstract_tablesknbs_cache_clearknbs_cache_dirknbs_cache_infoknbs_cache_pruneknbs_citeknbs_county_codeknbs_download_finaccessknbs_download_microdataknbs_download_publicationknbs_finaccess_filesknbs_geographiesknbs_get_indicatorknbs_indicatorsknbs_match_countiesknbs_metadataknbs_optionknbs_optionsknbs_publicationsknbs_read_microdataknbs_release_seriesknbs_releasesknbs_retail_pricesknbs_searchknbs_search_surveysknbs_sourcesknbs_statusknbs_survey_filesknbs_survey_metadataknbs_variablesknbs_write

Dependencies:askpasscellrangerclicpp11crayoncurldigestgluehmshttr2jsonlitelifecyclemagrittropensslpillarpkgconfigprettyunitsprogressR6readxlrematchrlangsystibbleutf8vctrswithryaml

County codes and joins
The reference | The two classic corruptions | A worked join | Gross County Product | Health by county: the KDHS | Matching county names across sources | What is deliberately absent

Last update: 2026-11-25
Started: 2026-11-25

Getting started with knbsdata
What is and is not in this version | Five ideas worth knowing | 1. Everything carries its provenance | 2. Citations come from the data, not from you | 3. Access conditions are data, not decoration | 4. Failure is explicit | 5. Everything is a tibble that speaks tidyverse | A first session | Configuration | Caching | Where to next

Last update: 2026-11-25
Started: 2026-11-25

Indicators: census tables and consumer prices
The Data Portal (SDMX) | Open Data for Africa (the republisher) | Consumer prices | CPI geography is not census geography | Retail prices | Census tables | What the census source is, and is not | Finding a table | Getting observations | Filtering geography | A worked example | Provenance and citation | Honesty notes

Last update: 2026-11-25
Started: 2026-11-25

Source status and limitations
Registered sources | What each stability level means | What works | What does not, and why | The archive's microdata cannot be downloaded | Documentation files are not listed | The newest Gross County Product years are still documents | Geography: one vintage, no boundaries, no classifications | Variable documentation is uneven | How you will know if something changes | Reporting a change | Disclaimer

Last update: 2026-11-25
Started: 2026-11-25

The Statistical Abstract as tidy tables
Curated, not guessed | Listing and fetching | Reading the columns | County tables join everything else | Units, footnotes and sources | Into the tidyverse | Provenance travels | What this is not

Last update: 2026-11-25
Started: 2026-11-25

Working with the survey catalogue
What is supported | Finding a survey | Reading a study's documentation | Searching variables | Files, and what you may do with them | Downloading microdata | Open microdata: the FinAccess surveys | Handling errors | Citing what you used | Caching

Last update: 2026-11-25
Started: 2026-11-25

Readme and manuals

Help Manual

Help pageTopics
Retrieve one Statistical Abstract table as tidy observationsknbs_abstract_table
List the curated Statistical Abstract tablesknbs_abstract_tables
Empty the cacheknbs_cache_clear
Where knbsdata stores cached responsesknbs_cache_dir
What is in the cacheknbs_cache_info
Remove expired cache entriesknbs_cache_prune
Cite a knbsdata objectknbs_cite
Official county codes for county names written any wayknbs_county_code
Download FinAccess survey filesknbs_download_finaccess
Download public-use microdataknbs_download_microdata
Download a publication and verify what arrivedknbs_download_publication
List the FinAccess survey filesknbs_finaccess_files
Kenya's geographic reference codesknbs_geographies
Retrieve an indicator as tidy observationsknbs_get_indicator
List available aggregate indicatorsknbs_indicators
See how county names were matchedknbs_match_counties
Inspect the provenance of a knbsdata objectknbs_metadata
Get a knbsdata optionknbs_option
Set knbsdata optionsknbs_options
Search official KNBS publicationsknbs_publications
Read a microdata file into Rknbs_read_microdata
KNBS's regular release seriesknbs_release_series
What KNBS has released latelyknbs_releases
National average retail prices of the CPI basket commoditiesknbs_retail_prices
Search everything the package can retrieveknbs_search
Search official survey and census studiesknbs_search_surveys
Supported KNBS sourcesknbs_sources
Report on the health of supported sourcesknbs_status
List the data files belonging to a studyknbs_survey_files
Retrieve the full metadata record for a studyknbs_survey_metadata
Search the variables described by a studyknbs_variables
Write KNBS data to a file, with its provenanceknbs_write