← Blog · 2026-07-11

eolas from R

worked-example r ggplot2 rbnz geospatial

A lot of the people who ask me about eolas live in R: policy shops, researchers, anyone who’s already got a ggplot muscle memory. The Python client gets more airtime on the marketing site because it’s what I write day-to-day, but the R package is a first-class client, not an afterthought.

Same API key as Python. Same catalogue. Returns tibbles (and sf for boundaries).

Install

From r-universe (pre-built binary of eolas itself):

install.packages(
  "eolas",
  repos = c("https://phildonovan.r-universe.dev", "https://cloud.r-project.org")
)

On Linux, heavy deps like arrow / sf may still compile unless you use Posit Package Manager or your distro’s r-cran-* packages. That’s an R ecosystem fact, not an eolas quirk.

Or source from GitHub: remotes::install_github("phildonovan/eolas-r").

One-time key setup (shared with the Python client — same OS keyring slot):

# install.packages("keyring")   # once; Linux needs libsecret
library(eolas)
eolas_key_save()   # masked prompt → keyring
# or: eolas_key("vs_…") for this session only

The same join as the Python post — in R

OCR and CPI in one script in Python. Here’s the R twin:

library(eolas)
library(dplyr)
library(ggplot2)

cpi <- eolas_get("nz_cpi")                          # OECD — annual % change, quarterly
ocr <- eolas_get_rbnz("rbnz_b2_wholesale_rates_monthly")

cpi$date <- as.Date(cpi$date)
ocr$date <- as.Date(ocr$date)

merged <- cpi |>
  left_join(
    ocr |> select(date, cash_rate_official_cash_rate_ocr),
    by = "date"
  ) |>
  arrange(date)

tail(merged)

ggplot(merged, aes(date)) +
  geom_line(aes(y = value, colour = "CPI YoY %")) +
  geom_line(aes(y = cash_rate_official_cash_rate_ocr, colour = "OCR %")) +
  labs(
    title = "NZ inflation and the Official Cash Rate",
    y = NULL, colour = NULL,
    caption = "Sources: OECD (via eolas), RBNZ"
  ) +
  theme_minimal()

Same caveats as the Python write-up: column names are stable but source-shaped; quarterly vs monthly needs an explicit join choice; OECD is query-only for redistribution — CC-BY NZ tables are the ones for bulk/share.

Source-specific helpers (eolas_get_rbnz(), eolas_get_statsnz(), …) are optional sugar. eolas_get("nz_cpi") is enough once you know the name. Discover with:

eolas_search("cpi")
eolas_list("RBNZ") |> head()
eolas_info("rbnz_b2_wholesale_rates_monthly")

Boundaries without the ArcGIS detour

library(sf)

sa2 <- eolas_get("nz_statistical_area_2_2023")  # sf, WGS84 when sf is installed
class(sa2)
# [1] "sf"  "tbl_df"  ...

# Small choropleth sketch — replace fill with your join key
ggplot(sa2) +
  geom_sf(aes(fill = land_area_sq_km), colour = NA) +
  scale_fill_viridis_c(trans = "log10") +
  labs(title = "SA2 land area", fill = "km²") +
  theme_void()

For huge layers (nz_parcels is millions of rows), don’t materialise everything as sf on a laptop. Use bulk/cache routing and, if needed, as_arrow = TRUE so geometry stays cheap until you filter — details in the R docs and package README.

Where this fits

You want… Do this
Explore / brief eolas_get + ggplot in a session or Quarto doc
Repeatable job Rscript / targets / cron calling the same helpers
Warehouse Prefer Snowflake share if you have it; otherwise schedule R or the CLI into your load path
Team onboarding Same free key as Python — signup

The live demo at NZ Economic Overview is an R Shiny app built on this package — proof it isn’t only “works on my machine.”

Docs: docs.eolas.fyi/r. Package: r-universe / GitHub. If something R-shaped is awkward (ggplot helpers, CRAN vs r-universe friction, a missing series), tell me.

Try it free

Get an API key in seconds — 10 requests per month on the Free plan, no credit card.

Get your free API key →