Skip to contents

Read a brreg bulk CSV file (as downloaded by brreg_download() or from the brreg website), normalize column names via field_dict, and save as a dated Parquet partition in the snapshot store.

Usage

brreg_import(
  path,
  snapshot_date,
  type = c("enheter", "underenheter", "roller"),
  force = FALSE
)

Arguments

path

Path to a brreg CSV file (gzipped or plain).

snapshot_date

The date this CSV represents. Required — the CSV itself contains no date metadata.

type

One of "enheter" or "underenheter".

force

Logical. Overwrite existing partition.

Value

The file path to the written Parquet partition (invisibly).

See also

brreg_snapshot() to download and save today's register.

Other tidybrreg snapshot functions: brreg_cleanup(), brreg_data_dir(), brreg_manifest(), brreg_open(), brreg_snapshot(), brreg_snapshots()

Examples

if (FALSE) {
# Import a historical download
brreg_import("enheter_2024-12-31.csv.gz", snapshot_date = "2024-12-31")
}