Logo Lanfrica

laws2020/opennaijR

Domain:

socioeconomic

Record type:

software
Creator:
law
Host:
Reproducible Macroeconomic Data Engineering for Nigeria and Africa # opennaijR ***opennaijR*** simplifies access to Nigerian open data from the CBN, NBS, NGX, and other sources. It automates the cleaning of official datasets, turning hours of manual work into seconds of analysis-ready results. It is a reproducible macroeconomic data engineering for Nigeria. Use `discover_datasets()` to find your variable of interest, then pass it to `cbn()` to start downloading. ## Workflow The typical workflow is three steps: discover_datasets() --> cbn() --> analyse ## Installation ``` r #Install released version from GitHub using remotes: install.packages("remotes") remotes::install_github("laws2020/opennaijR") ``` ## Usage ### Search for available datasets Before pulling data with `cbn()`, you need to know what is available. Use `discover_datasets()`, it is the entry point to opennaijR. Users should **never guess dataset names**. It returns: - available datasets exist - their source (CBN, WB, NBS, etc.) - available indicators ``` r discover_datasets()|> print(n = 6) ``` ## # A tibble: 23 × 5 ## dataset_key dataset_id source aliases variables ## ## 1 crude_oil cbn_crude_oil CBN crude oil, oil price, bo… price_bo… ## 2 daily_crude_oil cbn_daily_crude_oil CBN daily crude oil, daily o… price_bo… ## 3 discount_rates cbn_discount_rates CBN discount rates, discount… discount… ## 4 ntb_cbn cbn_ntb CBN ntb, nigeria treasury bi… total_su… ## 5 fgn_bond cbn_fgn_bond CBN fgn bond, fgn bonds, nig… total_su… ## 6 omo cbn_omo CBN omo, open market operati… total_su… ## # ℹ 17 more rows Alternative: print everything: ``` r discover_datasets() |> print(n = Inf) ``` ### Download the Data Once you have found a dataset name using `discover_datasets()`, pass it to `cbn()` to download the data into your R session. You can use either the dataset_key or an alias. For example, to retrieve official inflation data from the Central …