Preparing caches

How to produce the .rds caches that the Pooled App reads from the RMNCAH or Vaxx app, and what makes a cache loadable and comparable across countries.

Pooled reads the caches that the country apps save. A cache is an .rds file that holds a country's dataset together with everything computed on it: adjusted data, coverage, data quality results and the choices made in the analysis. Good pooled results depend on well-prepared caches, so it is worth a few minutes to get them right.

This is the step before Pooled: you prepare one cache per country in the RMNCAH or Vaxx app, put them in one folder, then build the pooled file.

Before you start: have each country's data loaded in the RMNCAH or Vaxx app (Load Data).

flowchart TD
  A["Load Data"] --> B["Data Quality Assessment"]
  B --> C["Data Adjustment"]
  C --> D["Denominator Selection"]
  D --> E["Dataset saved (.rds)"]
  E --> F["One folder, one file per country"]:::done
  C -. "skipped" .-> W["Loads with a warning: unadjusted data"]:::warn

Producing a cache

  1. Open the RMNCAH App (or the Vaxx App) and upload the country's data. The data usually comes from the Data Extractor.
  2. Work through the analysis: data quality checks, data preparation and adjustment, and denominator selection. See the analytical framework.
  3. The app saves the cache as an .rds file in the same folder as the file you opened, named after it: mydata.xlsx is saved as mydata_rmncah.rds by the RMNCAH app and mydata_vaccine.rds by the Vaxx app. If that .rds already exists, it is opened again instead of a new one being created. See The saved .rds file.

Repeat for each country, using the same app and the same domain for all of them.

Important:

Complete the adjustment and denominator steps before pooling. A cache that is not adjusted still loads, but Pooled warns that its tables use unadjusted data, and coverage will not be comparable with countries that were adjusted.

What makes a cache loadable

For each file, Pooled opens it as a Countdown cache for the domain you chose and then checks:

  • The file can be read by R. A damaged file, or one saved by a newer version of R, is reported as unreadable.
  • The cache contains a country name. Files without a country or without adjusted data are reported as "Not a Countdown dataset".
  • At least one table can be built. Standard tables that cannot be built produce a warning that lists them.

The country and its ISO3 code come from inside the cache, not from the file name.

Naming and folders

  • Only files ending in .rds (any letter case) are used. Other files are listed as skipped.
  • Put all the countries you want to pool in one folder. Selecting a folder adds every .rds file inside it.
  • Keep a clear name, ideally with the date at the end, for example Country_master_adj_dataset_20250918.rds. Pooled reads the last run of eight digits in the name as the file date (year, month, day). If there is none, the file's modified time is used.
  • Keep one file per country. If two selected files are for the same country (matched by ISO3 code), Pooled keeps the one with the newer date and leaves the other out, with a reason in the log.
  • Remove old versions and unrelated .rds files from the folder, or untick them in step 1.

Compatibility notes

  • All caches must be loadable by the version of cd2030.core installed with DataSuite (the Pooled package requires version 1.1.0 or later). Caches carry an internal data version, so if an old file fails to load, open and re-save it in the country app first.
  • Countries can have different tables. Data quality or survey tables, for example, may exist for some countries only. Pooled records what each file lacks and flags it in the review step rather than failing.
  • If the columns of one table differ between countries in type, they are combined as text and a note is written to the file log.

Common pitfalls

  • Pooling the Excel workbook. Pooled reads the .rds the app saved, not the workbook from the Data Extractor.
  • Renaming the saved .rds. The app finds a dataset again by its name next to the workbook; copy it to the pooling folder rather than renaming the original.
  • Old and new versions together. Keep one file per country in the folder, with the date at the end of its name.

Next: Using the app.