Package {sencensus}


Type: Package
Title: Access to Senegal Demographic and Census Datasets
Version: 0.1.0
Date: 2026-09-15
Description: Download, cache, and analyze census datasets and demographic statistics from Senegal. Datasets are sourced from public census releases provided by the Agence Nationale de la Statistique et de la Demographie (ANSD) https://www.ansd.sn and hosted on GitHub releases https://github.com/Amady01/sencus. Also provides tools to search through variable dictionaries and load tabular demographic indicators.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.2.3
Imports: jsonlite, httr, readr, readxl
URL: https://github.com/Amady01/sencusR
BugReports: https://github.com/Amady01/sencusR/issues
NeedsCompilation: no
Packaged: 2026-09-15 11:20:02 UTC; amsal
Author: Amadou SALL ORCID iD [aut, cre]
Maintainer: Amadou SALL <amadymail01@gmail.com>
Repository: CRAN
Date/Publication: 2026-09-26 16:20:02 UTC

Telecharger un dataset du recensement / Download a census dataset

Description

Telecharger un dataset du recensement / Download a census dataset

Usage

download(dataset_id, force = FALSE)

Arguments

dataset_id

L'identifiant du dataset (ex: 2013, "projection") / Dataset identifier (e.g., 2013, "projection")

force

Telecharger meme si le fichier est deja en cache / Logical, whether to force download even if cached

Value

A character string specifying the local file path to the downloaded/cached file (returned invisibly).

Examples


download("projection")


Obtenir le dictionnaire des variables / Get the variable dictionary

Description

Obtenir le dictionnaire des variables / Get the variable dictionary

Usage

get_dictionary(year)

Arguments

year

L'annee du recensement (ex: 2023) / Census year (e.g., 2023)

Value

A data.frame containing the variable dictionary (variable codes, labels, and descriptions) for the given census year.

Examples

get_dictionary(2023)

Lister les recensements disponibles / List available censuses

Description

Lister les recensements disponibles / List available censuses

Usage

list_census()

Value

A data.frame containing the list of available census datasets with columns 'id', 'year', 'name', and 'description'.

Examples

list_census()

Charger un dataset dans R / Load a dataset into R

Description

Charger un dataset dans R / Load a dataset into R

Usage

load_dataset(dataset_id)

Arguments

dataset_id

L'identifiant (ex: 2013, "projection", "coordonnées") / Dataset identifier (e.g., 2013, "projection")

Value

A data.frame (or tibble) containing the census dataset loaded into memory.

Examples


download("projection")
df <- load_dataset("projection")
head(df)


Chercher des variables dans le dictionnaire / Search variables in dictionary

Description

Chercher des variables dans le dictionnaire / Search variables in dictionary

Usage

search_variables(keyword, year = 2023)

Arguments

keyword

Mot-cle a chercher / Search keyword

year

L'annee du recensement (par defaut 2023) / Census year (default 2023)

Value

A data.frame containing the matching variable dictionary rows.

Examples

search_variables("ethnie", 2023)