mdpath: Path of a bundled table's shipped file

View source: R/data_store.R

mdpathR Documentation

Path of a bundled table's shipped file

Description

The absolute path of the CSV or Parquet copy of a table, verified against the signed manifest first. The Parquet path is the bridge to Python: pandas.read_parquet(path) gives the same typed table mdload() returns.

Usage

mdpath(slug, format = c("parquet", "csv"))

Arguments

slug

Dataset slug; see the slug column of mdcat().

format

"parquet" (default) or "csv". A dictionary or other non-table slug has one file, which is returned either way.

Details

Every call checks the file again: its SHA-256 is computed and compared with the manifest's (the store's files are small; the largest takes a few tens of milliseconds), so a file changed since an earlier call is refused, whatever else about it stayed the same. What is not covered: a change made after the path is returned, before it is read. mdload() has no such gap: it reads a file's bytes once, checks them and reads the table from them.

Value

A length-1 character path.

Examples

p <- mdpath("arsau_2023_uof_main_records")
file.exists(p)
basename(mdpath("arsau_2023_uof_main_records", "csv"))

rmoriedata documentation built on Nov. 18, 2026, 5:06 p.m.