Package: knbsdata 0.5.0

Mustapha Wasseja Mohammed

knbsdata: Discover, Retrieve and Cite Official Kenyan Statistics

An R client and standardisation layer for official data and statistical products published by the Kenya National Bureau of Statistics (KNBS). Provides a consistent interface for discovering surveys, publications, aggregate indicators and geographic reference data, 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.zip(r-4.5-any)
knbsdata_0.5.0.tgz(r-4.6-any)knbsdata_0.5.0.tgz(r-4.5-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://mustapha-wasseja.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:

4.08 score 32 exports 28 dependencies

Last updated from:38fa7f1315. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK170
source / vignettesOK251
linux-releaseOK187
macos-releaseOK142
macos-oldrelOK140
windows-develOK166
windows-releaseOK141
windows-oldrelOK160
wasm-releaseOK112

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

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-10-20
Started: 2026-08-08

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-10-08
Started: 2026-08-08

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-10-08
Started: 2026-08-08

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-10-08
Started: 2026-08-03

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-10-05
Started: 2026-08-11

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-10-05
Started: 2026-08-08

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