| Title: | Tidy Access to Norway's Business Registry ('Enhetsregisteret') |
|---|---|
| Description: | A tidy interface to download, search, and analyze data from the Norwegian Central Coordinating Register for Legal Entities (Enhetsregisteret), maintained by the Brønnøysund Register Centre. Provides access to registration data for approximately 1 million legal entities including companies, partnerships, sole proprietorships, associations, and government bodies. Returns tibbles with English column names mapped via a data-driven dictionary; unknown API fields pass through with auto-generated names. Coded values (legal forms, industry codes, roles) can be translated to English on demand using bundled reference data or live lookups from the SSB Klass API. Data is freely available under the Norwegian Licence for Open Government Data (NLOD 2.0). |
| Authors: | Sondre Skarsten [aut, cre] |
| Maintainer: | Sondre Skarsten <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.8 |
| Built: | 2026-06-06 21:05:39 UTC |
| Source: | https://github.com/sondreskarsten/tidybrreg |
Maps brreg påtegning infotype codes to English descriptions. Used by
brreg_annotations() when translate = TRUE. Covers the infotype
codes documented in the brreg API reference ("NAVN", "FADR") and
those observed in live data (role codes used for missing-role
annotations); unknown codes pass through unchanged. Each annotation's
own Norwegian text is available in the tekst column of
brreg_annotations() output.
annotation_infotypesannotation_infotypes
A tibble with 7 rows and 2 columns:
Annotation infotype code (e.g. "FADR", "NAVN").
English description.
brreg_annotations() for the function that uses this table.
Other tidybrreg reference data:
field_dict,
legal_forms,
role_groups,
role_types
annotation_infotypesannotation_infotypes
Convert the output of brreg_panel() or brreg_series() to a
tsibble for use with the tidyverts ecosystem (fable, feasts,
slider). Uses regular = FALSE since brreg snapshots are
irregularly spaced.
as_brreg_tsibble(x, key = NULL, index = NULL)as_brreg_tsibble(x, key = NULL, index = NULL)
x |
A tibble from |
key |
Character vector of key column(s). For panels, typically
|
index |
Character. Name of the time index column. Default
|
A tsibble.
brreg_panel(), brreg_series().
Other tidybrreg panel functions:
brreg_change_summary(),
brreg_changes(),
brreg_events(),
brreg_flows(),
brreg_panel(),
brreg_replay(),
brreg_series()
panel <- brreg_panel(cols = c("employees", "legal_form")) as_brreg_tsibble(panel)panel <- brreg_panel(cols = c("employees", "legal_form")) as_brreg_tsibble(panel)
Quick summary of how many entities currently carry påtegninger, grouped by annotation type.
brreg_annotation_summary()brreg_annotation_summary()
A tibble with infotype and n.
Other tidybrreg data management functions:
brreg_annotations(),
brreg_status(),
brreg_sync(),
brreg_sync_status(),
diff_roller_state(),
read_changelog()
brreg_annotation_summary()brreg_annotation_summary()
Påtegninger are public annotations placed on entities by the register keeper to warn third parties of irregularities — missing board members, undelivered accounts, deceased officers. They are the earliest formal signal that an entity is in regulatory trouble, preceding forced dissolution warnings by weeks to months.
brreg_annotations( org_nr = NULL, infotype = NULL, active_only = TRUE, translate = FALSE )brreg_annotations( org_nr = NULL, infotype = NULL, active_only = TRUE, translate = FALSE )
org_nr |
Optional character vector of organisation numbers.
|
infotype |
Optional character vector of annotation type codes
to filter by (e.g. |
active_only |
Logical. If |
translate |
Logical. If |
Requires brreg_sync() to have been run at least once to
populate the local påtegninger state.
A tibble with columns: org_nr, position (array
index), infotype, tekst (annotation text),
innfoert_dato (date introduced). With translate = TRUE, an
infotype_desc column is inserted after infotype.
brreg_sync() to populate annotation data,
brreg_changes() to track annotation events over time,
annotation_infotypes for the English infotype lookup table.
Other tidybrreg data management functions:
brreg_annotation_summary(),
brreg_status(),
brreg_sync(),
brreg_sync_status(),
diff_roller_state(),
read_changelog()
brreg_sync() brreg_annotations() brreg_annotations(infotype = "FADR") brreg_annotations(translate = TRUE)brreg_sync() brreg_annotations() brreg_annotations(infotype = "FADR") brreg_annotations(translate = TRUE)
Construct a bipartite graph of entities and persons linked by
board/officer roles. Returns a tbl_graph (tidygraph) object
suitable for centrality analysis and ggraph visualization.
brreg_board_network(org_nrs = NULL, roles_data = NULL)brreg_board_network(org_nrs = NULL, roles_data = NULL)
org_nrs |
Character vector of organization numbers to include.
Roles are fetched via |
roles_data |
Optional pre-fetched roles tibble (from
|
For a full ego network including sub-units, child entities, and
legal roles in addition to board roles, use brreg_network()
instead.
A tbl_graph with two node types: "entity" (identified
by org_nr) and "person" (identified by person_id). Edge
attributes include role_code, role_group_code, and org_nr.
brreg_network() for full entity network graphs,
brreg_roles() to fetch role data,
brreg_board_summary() for board-level covariates.
Other tidybrreg governance functions:
brreg_network(),
brreg_survival_data()
net <- brreg_board_network(c("923609016", "984851006")) netnet <- brreg_board_network(c("923609016", "984851006")) net
Compute firm-level variables commonly used in corporate governance research: board size, composition counts, and officer indicators.
brreg_board_summary(roles)brreg_board_summary(roles)
roles |
A tibble returned by |
A 1-row tibble with columns: org_nr, board_size,
n_chair, n_deputy_chair, n_members, n_alternates,
n_observers, n_employee_elected, has_ceo, has_auditor,
auditor_org_nr. Counts exclude resigned and deregistered roles.
brreg_roles() for the underlying role data.
Other tidybrreg entity functions:
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
brreg_roles("923609016") |> brreg_board_summary()brreg_roles("923609016") |> brreg_board_summary()
Produces a count table of how many changes occurred per field and change type, useful for understanding the volume and distribution of registry mutations.
brreg_change_summary(from = NULL, to = NULL, registry = NULL)brreg_change_summary(from = NULL, to = NULL, registry = NULL)
from, to
|
Date range (inclusive). |
registry |
Character vector of streams to include. Default includes all four. |
A tibble with registry, change_type, field, n.
brreg_changes() for raw changelog rows,
brreg_sync() to populate the changelog.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_changes(),
brreg_events(),
brreg_flows(),
brreg_panel(),
brreg_replay(),
brreg_series()
brreg_change_summary(from = Sys.Date() - 7)brreg_change_summary(from = Sys.Date() - 7)
Returns a filtered view of all recorded changes across the four
sync streams: enheter, underenheter, roller, and påtegninger.
Every call to brreg_sync() appends events to the changelog;
this function reads and filters them.
brreg_changes( track = NULL, registry = NULL, change_type = NULL, from = NULL, to = NULL, org_nr = NULL )brreg_changes( track = NULL, registry = NULL, change_type = NULL, from = NULL, to = NULL, org_nr = NULL )
track |
Character vector of fields to include (e.g.
|
registry |
Character vector of streams to include. Default includes all four. |
change_type |
Character vector of event types to include.
Options: |
from, to
|
Date range (inclusive). |
org_nr |
Optional character vector of organisation numbers. |
A tibble with columns: timestamp, org_nr,
registry, change_type, field, value_from,
value_to, update_id.
brreg_sync() to populate the changelog,
brreg_flows() for aggregated entry/exit counts.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_change_summary(),
brreg_events(),
brreg_flows(),
brreg_panel(),
brreg_replay(),
brreg_series()
brreg_sync() # All changes this month brreg_changes(from = Sys.Date() - 30) # NACE reclassifications only brreg_changes(track = "nace_1", change_type = "change") # Entries and exits for a specific entity brreg_changes(org_nr = "923609016", change_type = c("entry", "exit")) # All annotation events brreg_changes(registry = "paategninger")brreg_sync() # All changes this month brreg_changes(from = Sys.Date() - 30) # NACE reclassifications only brreg_changes(track = "nace_1", change_type = "change") # Entries and exits for a specific entity brreg_changes(org_nr = "923609016", change_type = c("entry", "exit")) # All annotation events brreg_changes(registry = "paategninger")
Query the enheter registry for entities whose overordnetEnhet
matches the given org number. This traverses the ORGL parent-child
hierarchy (e.g. Stortinget to Riksrevisjonen), which is distinct
from the enhet-to-underenhet relationship.
brreg_children(org_nr, max_results = 200, type = c("code", "label"))brreg_children(org_nr, max_results = 200, type = c("code", "label"))
org_nr |
Character. 9-digit organization number of the parent entity (hovedenhet). |
max_results |
Integer. Maximum sub-units to return (default 200). |
type |
One of |
A tibble with one row per child entity. Same column schema
as brreg_search() with registry = "enheter".
brreg_underenheter() for sub-units (BEDR/AAFY),
brreg_entity() for single lookups.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
brreg_children("971524960")brreg_children("971524960")
Delete snapshot partitions by count or age. At least one of
keep_n or max_age_days must be provided.
brreg_cleanup( keep_n = NULL, max_age_days = NULL, type = c("enheter", "underenheter", "roller") )brreg_cleanup( keep_n = NULL, max_age_days = NULL, type = c("enheter", "underenheter", "roller") )
keep_n |
Integer. Keep the |
max_age_days |
Integer. Delete snapshots older than this many
days. |
type |
One of |
A tibble of deleted snapshots (invisibly).
brreg_snapshots() to list available snapshots,
brreg_data_dir() for storage location.
Other tidybrreg snapshot functions:
brreg_data_dir(),
brreg_import(),
brreg_manifest(),
brreg_open(),
brreg_snapshot(),
brreg_snapshots()
brreg_cleanup(keep_n = 12) brreg_cleanup(max_age_days = 365)brreg_cleanup(keep_n = 12) brreg_cleanup(max_age_days = 365)
Returns (and creates if needed) the directory where tidybrreg stores
Parquet snapshots. Location follows R's standard user data directory
convention via tools::R_user_dir("tidybrreg", "data").
Override with options(brreg.data_dir = "/custom/path").
brreg_data_dir()brreg_data_dir()
Character path.
brreg_snapshot() to save snapshots,
brreg_open() to read them.
Other tidybrreg snapshot functions:
brreg_cleanup(),
brreg_import(),
brreg_manifest(),
brreg_open(),
brreg_snapshot(),
brreg_snapshots()
brreg_data_dir()brreg_data_dir()
Download a complete extract of the Central Coordinating Register for
Legal Entities (~1 million entities, ~145 MB gzipped). The bulk endpoint
does not support server-side filtering — it always returns all entities.
Use brreg_search() for filtered queries up to 10,000 results, or
download the full register here and filter locally.
brreg_download( type = c("enheter", "underenheter", "roller"), format = c("csv", "json"), refresh = FALSE, cache = TRUE, type_output = c("tibble", "arrow", "path") )brreg_download( type = c("enheter", "underenheter", "roller"), format = c("csv", "json"), refresh = FALSE, cache = TRUE, type_output = c("tibble", "arrow", "path") )
type |
One of |
format |
Download format: |
refresh |
|
cache |
Logical. If |
type_output |
One of |
Depends on type_output:
"tibble": A tibble with ~1 million rows. Column names mapped
via field_dict.
"arrow": An Arrow Table (lazy, not loaded into memory).
"path": Character file path to the cached CSV.
The brreg API has two data access paths with fundamentally different characteristics, following the cansim (Statistics Canada) pattern of separate functions for separate access patterns rather than the eurostat pattern of auto-routing within one function:
brreg_search(): JSON API with server-side filtering. Fast for
small result sets, capped at 10,000. Interactive exploration.
brreg_download(): Bulk CSV. Always returns the full register.
Appropriate for panel construction, spatial joins, or any analysis
requiring more than 10,000 entities.
Results from both paths use the same column names via field_dict.
Downloaded files are cached in tools::R_user_dir("tidybrreg", "cache")
as gzipped CSV. Use refresh = TRUE to force re-download, or
refresh = "auto" to re-download only if the cached file is older
than the latest nightly bulk export (checked via ETag headers, following
the cansim refresh = "auto" pattern).
brreg_search() for filtered API queries,
brreg_updates() for incremental changes since a given date.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
# Download full register as tibble (~145MB download, ~1M rows) entities <- brreg_download() # Just get the file path (no parsing) path <- brreg_download(type_output = "path") # Force refresh entities <- brreg_download(refresh = TRUE)# Download full register as tibble (~145MB download, ~1M rows) entities <- brreg_download() # Just get the file path (no parsing) path <- brreg_download(type_output = "path") # Force refresh entities <- brreg_download(refresh = TRUE)
Retrieve registration details for a legal entity from Norway's Central Coordinating Register for Legal Entities (Enhetsregisteret), maintained by the Brønnøysund Register Centre. Every legal entity operating in Norway is assigned a unique 9-digit organization number and registered in this central register.
brreg_entity( org_nr, registry = c("auto", "enheter", "underenheter"), type = c("code", "label") )brreg_entity( org_nr, registry = c("auto", "enheter", "underenheter"), type = c("code", "label") )
org_nr |
Character. A 9-digit Norwegian organization number.
Validated using |
registry |
One of |
type |
A type of variables: |
Column names are translated from Norwegian to English via the package
field dictionary (field_dict). API fields not in the dictionary pass
through with auto-generated snake_case names, so new fields added by
brreg are never silently dropped. Use brreg_label() to translate
coded values (legal forms, NACE codes) to English descriptions.
A tibble with one row and one column per API field. Column
names follow the package field dictionary. Key columns include
org_nr, name, legal_form, employees, founding_date,
nace_1, municipality_code, bankrupt, and parent_org_nr.
For deleted entities (HTTP 410), returns a tibble with columns
org_nr, deleted, and deletion_date.
brreg_search() for querying multiple entities,
brreg_label() for translating codes to English,
field_dict for the column name mapping.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
# Equinor ASA — Norway's largest company brreg_entity("923609016") # With English labels (eurostat pattern) brreg_entity("923609016", type = "label") # Or pipe to brreg_label() for more control brreg_entity("923609016") |> brreg_label(code = "legal_form")# Equinor ASA — Norway's largest company brreg_entity("923609016") # With English labels (eurostat pattern) brreg_entity("923609016", type = "label") # Or pipe to brreg_label() for more control brreg_entity("923609016") |> brreg_label(code = "legal_form")
Compare two dated snapshots and return a tibble of entity-level events: entries (new entities), exits (deleted entities), and field-level changes. Unlike the CDC stream, snapshot diffs provide both old and new values for every changed field.
brreg_events( date_from, date_to, cols = NULL, type = c("enheter", "underenheter") )brreg_events( date_from, date_to, cols = NULL, type = c("enheter", "underenheter") )
date_from, date_to
|
Dates identifying the two snapshots to
compare. Both must exist in the snapshot store. |
cols |
Character vector of columns to track for changes.
|
type |
One of |
A tibble with columns: org_nr, event_type
("entry", "exit", "change"), event_date (the date_to
snapshot date), field (column name, NA for entry/exit),
value_from (character, previous value), value_to (character,
new value).
brreg_updates() for the CDC stream (API-level changes),
brreg_panel() for full panel construction.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_change_summary(),
brreg_changes(),
brreg_flows(),
brreg_panel(),
brreg_replay(),
brreg_series()
snaps <- brreg_snapshots() if (nrow(snaps) >= 2) { events <- brreg_events(snaps$snapshot_date[1], snaps$snapshot_date[2]) events }snaps <- brreg_snapshots() if (nrow(snaps) >= 2) { events <- brreg_events(snaps$snapshot_date[1], snaps$snapshot_date[2]) events }
Calculate daily counts of entity registrations (entries) and deletions (exits) classified by industry (NACE code) and geography (municipality code). Three data paths, selected automatically:
brreg_flows( data = NULL, updates = NULL, by = c("nace_1", "municipality_code"), from = NULL, to = NULL, legal_form = NULL )brreg_flows( data = NULL, updates = NULL, by = c("nace_1", "municipality_code"), from = NULL, to = NULL, legal_form = NULL )
data |
Optional. A tibble from |
updates |
Optional. A tibble from |
by |
Character vector of grouping columns. Default
|
from, to
|
Date range for the output. |
legal_form |
Optional character vector of legal form codes
to include (e.g. |
Changelog path (preferred) — when brreg_sync() has been
run, reads directly from the persistent changelog. Provides
timestamped entries, exits, and field-level transitions.
No arguments needed.
Bulk + CDC path — pass data (from brreg_download())
and optionally updates (from brreg_updates()).
Registration dates provide historical entries; CDC provides
recent entries + exits.
Bulk-only path — pass data alone. Only entries are
computed (no exit data available).
A tibble with columns: date (Date), grouping columns
from by, entries (integer), exits (integer), net
(integer: entries - exits). An attribute flow_source records
which data sources contributed.
This function uses registration_date
(registreringsdatoEnhetsregisteret), NOT founding_date
(stiftelsesdato). Registration date is when the entity entered
the registry. Founding date can precede registration by months
(AS companies) or years (associations).
brreg_download() to get bulk data,
brreg_updates() to get CDC events,
brreg_series() for snapshot-based time series,
as_brreg_tsibble() for tsibble conversion.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_change_summary(),
brreg_changes(),
brreg_events(),
brreg_panel(),
brreg_replay(),
brreg_series()
entities <- brreg_download() flows <- brreg_flows(entities) # With CDC exits cdc <- brreg_updates(since = "2026-01-01", size = 10000) flows <- brreg_flows(entities, updates = cdc) # Monthly by NACE section flows |> dplyr::mutate(month = format(date, "%Y-%m"), nace_section = substr(nace_1, 1, 2)) |> dplyr::summarise(entries = sum(entries), exits = sum(exits), .by = c(month, nace_section))entities <- brreg_download() flows <- brreg_flows(entities) # With CDC exits cdc <- brreg_updates(since = "2026-01-01", size = 10000) flows <- brreg_flows(entities, updates = cdc) # Monthly by NACE section flows |> dplyr::mutate(month = format(date, "%Y-%m"), nace_section = substr(nace_1, 1, 2)) |> dplyr::summarise(entries = sum(entries), exits = sum(exits), .by = c(month, nace_section))
Remap municipality_code (kommunenummer) to the classification
valid at a target date, using correspondence tables from SSB's
KLASS system (classification 131). Handles the 2020 municipal
reform (428 → 356 municipalities) and 2024 county reversals.
brreg_harmonize_kommune( data, target_date = Sys.Date(), col = "municipality_code" )brreg_harmonize_kommune( data, target_date = Sys.Date(), col = "municipality_code" )
data |
A tibble with a municipality code column. |
target_date |
Date. Remap all codes to the classification valid at this date. Default: today. |
col |
Column name containing municipality codes. Default
|
The input tibble with two added columns:
{col}_harmonized (the remapped code) and
{col}_target_name (municipality name at the target date).
Unmatched codes pass through unchanged.
brreg_harmonize_nace() for NACE code harmonization.
Other tidybrreg harmonization functions:
brreg_harmonize_nace()
# Remap old codes to current boundaries df <- tibble::tibble(municipality_code = c("0301", "1201", "0602")) brreg_harmonize_kommune(df)# Remap old codes to current boundaries df <- tibble::tibble(municipality_code = c("0301", "1201", "0602")) brreg_harmonize_kommune(df)
Remap NACE codes between SN2007 (NACE Rev. 2) and SN2025 (NACE Rev. 2.1) using SSB KLASS correspondence tables.
brreg_harmonize_nace(data, from = "SN2007", to = "SN2025", col = "nace_1")brreg_harmonize_nace(data, from = "SN2007", to = "SN2025", col = "nace_1")
data |
A tibble with a NACE code column. |
from |
Source classification: |
to |
Target classification: |
col |
Column name containing NACE codes. Default |
The input tibble with {col}_harmonized (remapped code)
and {col}_ambiguous (logical, TRUE when the mapping is
one-to-many and the first match was used). Unmatched codes pass
through unchanged.
brreg_harmonize_kommune() for municipality harmonization.
Other tidybrreg harmonization functions:
brreg_harmonize_kommune()
df <- tibble::tibble(nace_1 = c("06.100", "64.190", "62.010")) brreg_harmonize_nace(df, from = "SN2007", to = "SN2025")df <- tibble::tibble(nace_1 = c("06.100", "64.190", "62.010")) brreg_harmonize_nace(df, from = "SN2007", to = "SN2025")
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.
brreg_import( path, snapshot_date, type = c("enheter", "underenheter", "roller"), force = FALSE )brreg_import( path, snapshot_date, type = c("enheter", "underenheter", "roller"), force = FALSE )
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 |
force |
Logical. Overwrite existing partition. |
The file path to the written Parquet partition (invisibly).
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()
# Import a historical download brreg_import("enheter_2024-12-31.csv.gz", snapshot_date = "2024-12-31")# Import a historical download brreg_import("enheter_2024-12-31.csv.gz", snapshot_date = "2024-12-31")
Replace coded values in a brreg tibble with English descriptions,
following the eurostat package's label_eurostat() pattern. Works on
both data frames and character vectors.
brreg_label(x, dic = NULL, code = NULL, lang = "en")brreg_label(x, dic = NULL, code = NULL, lang = "en")
x |
A tibble from |
dic |
A character string naming the dictionary to use when |
code |
For data frames: character vector of column names for
which to retain the original code alongside the label. A column
with suffix |
lang |
Language for NACE and sector labels. |
When x is a data frame: the same tibble with code columns
replaced by English labels. When x is a character vector: a
character vector of labels.
legal_forms, role_types, role_groups for bundled
reference data, get_brreg_dic() for fetching fresh dictionaries.
Other tidybrreg utilities:
brreg_validate(),
get_brreg_dic()
eq <- brreg_entity("923609016") # Label all code columns brreg_label(eq) # Keep original codes alongside labels brreg_label(eq, code = "legal_form") # Label a character vector directly brreg_label(c("AS", "ASA", "ENK"), dic = "legal_form")eq <- brreg_entity("923609016") # Label all code columns brreg_label(eq) # Keep original codes alongside labels brreg_label(eq, code = "legal_form") # Label a character vector directly brreg_label(c("AS", "ASA", "ENK"), dic = "legal_form")
Returns the provenance catalog recording every download: endpoint,
timestamps, HTTP headers, file hashes, and CDC bridge metadata.
The manifest lives at brreg_data_dir()/manifest.json.
brreg_manifest()brreg_manifest()
A tibble with one row per snapshot. Returns an empty tibble if no manifest exists.
brreg_snapshot() to create snapshots,
brreg_snapshots() to list them.
Other tidybrreg snapshot functions:
brreg_cleanup(),
brreg_data_dir(),
brreg_import(),
brreg_open(),
brreg_snapshot(),
brreg_snapshots()
brreg_manifest()brreg_manifest()
Construct a tbl_graph (tidygraph) representing the relationships
around one or more seed entities. At depth 1, the graph includes
sub-units, child entities, role holders, and legal role targets —
all reachable via direct API calls. At depth 2, the graph expands
through person nodes to discover board interlocks, requiring local
bulk data (see Details).
brreg_network( org_nr, depth = 1L, include = c("underenheter", "children", "roles", "legal_roles"), download = FALSE )brreg_network( org_nr, depth = 1L, include = c("underenheter", "children", "roles", "legal_roles"), download = FALSE )
org_nr |
Character vector of seed organization numbers. |
depth |
Integer. 0 = seed only, 1 = ego network (default), 2 = expand through persons (requires bulk data). |
include |
Character vector of relationship types to include.
Default includes all available types. Current types:
|
download |
Logical. If |
A tbl_graph with node attributes node_id, node_type,
name, org_nr, person_id, and edge attributes from, to,
edge_type, role_code, role.
Depth 0: Seed entity only. 1 API call per seed.
Depth 1: Full ego network. 5-7 API calls per seed.
Depth 2: Board interlocks via person-to-entity reverse lookup.
Requires local bulk data for enheter, underenheter, and roller.
Run brreg_snapshot() for each type first, or call with
download = TRUE to trigger downloads interactively.
The include parameter controls which relationship types are
traversed. Each type maps to an internal collector function.
Future versions may add types such as "addresses",
"prior_owners", or "accounting".
brreg_entity() for single lookups,
brreg_board_network() for the roles-only subgraph,
brreg_status() to check bulk data availability.
Other tidybrreg governance functions:
brreg_board_network(),
brreg_survival_data()
net <- brreg_network("923609016") net tidygraph::as_tibble(net, "nodes") tidygraph::as_tibble(net, "edges")net <- brreg_network("923609016") net tidygraph::as_tibble(net, "nodes") tidygraph::as_tibble(net, "edges")
Returns an Arrow Dataset with Hive-style partitioning on
snapshot_date. No data is loaded until dplyr::collect().
Requires the arrow package.
brreg_open(type = c("enheter", "underenheter", "roller"))brreg_open(type = c("enheter", "underenheter", "roller"))
type |
One of |
An arrow::Dataset object.
brreg_panel() for the higher-level panel constructor.
Other tidybrreg snapshot functions:
brreg_cleanup(),
brreg_data_dir(),
brreg_import(),
brreg_manifest(),
brreg_snapshot(),
brreg_snapshots()
ds <- brreg_open() dsds <- brreg_open() ds
Build an unbalanced firm × period panel from the Hive-partitioned
snapshot store. For each target period, selects the most recent
prior snapshot (LOCF). Requires at least two snapshots saved via
brreg_snapshot() or brreg_import().
brreg_panel( frequency = c("year", "quarter", "month", "custom"), cols = NULL, from = NULL, to = NULL, dates = NULL, max_gap = NULL, type = c("enheter", "underenheter", "roller"), label = FALSE )brreg_panel( frequency = c("year", "quarter", "month", "custom"), cols = NULL, from = NULL, to = NULL, dates = NULL, max_gap = NULL, type = c("enheter", "underenheter", "roller"), label = FALSE )
frequency |
One of |
cols |
Character vector of column names to include. |
from, to
|
Start and end dates for the panel. |
dates |
Date vector for |
max_gap |
Integer. Maximum number of periods a snapshot may
carry forward via LOCF. |
type |
One of |
label |
Logical. If |
A tibble with columns: org_nr, period (character label
for the period), snapshot_date (the actual snapshot used),
plus requested cols. Attribute date_mapping records which
snapshot was used for each period.
brreg_snapshot() to accumulate snapshots,
brreg_events() for change detection between snapshots.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_change_summary(),
brreg_changes(),
brreg_events(),
brreg_flows(),
brreg_replay(),
brreg_series()
# Annual panel of all entities panel <- brreg_panel() # Monthly panel for specific columns panel <- brreg_panel("month", cols = c("employees", "nace_1", "legal_form"))# Annual panel of all entities panel <- brreg_panel() # Monthly panel for specific columns panel <- brreg_panel("month", cols = c("employees", "nace_1", "legal_form"))
Given a base snapshot and a stream of CDC updates from
brreg_updates(), reconstruct the state of the register at any
arbitrary date. Uses dplyr::rows_upsert() for Ny/Endring events
and dplyr::rows_delete() for Sletting events, applied
chronologically.
brreg_replay(base, updates, target_date = Sys.Date(), cols = NULL)brreg_replay(base, updates, target_date = Sys.Date(), cols = NULL)
base |
A tibble from |
updates |
A tibble from |
target_date |
Date. Reconstruct state as of this date.
Only updates with |
cols |
Character vector of columns to track. If |
A tibble with the same columns as base, reflecting
all applied changes up to target_date. Attribute
replay_info records the number of inserts, updates, and
deletes applied.
The brreg CDC stream provides only new values (not old values)
in RFC 6902 JSON Patch format, and field-level changes are only
available from September 2025. Before that date, only the
change type (Ny/Endring/Sletting) is recorded — field-level
replay is not possible for those periods. Use brreg_events()
(snapshot diff) for pre-September 2025 field-level changes.
brreg_panel() for multi-snapshot panels,
brreg_updates() to fetch the CDC stream.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_change_summary(),
brreg_changes(),
brreg_events(),
brreg_flows(),
brreg_panel(),
brreg_series()
base <- brreg_download(type_output = "tibble") updates <- brreg_updates(since = Sys.Date() - 30, size = 10000, include_changes = TRUE) state <- brreg_replay(base, updates, target_date = Sys.Date())base <- brreg_download(type_output = "tibble") updates <- brreg_updates(since = Sys.Date() - 30, size = 10000, include_changes = TRUE) state <- brreg_replay(base, updates, target_date = Sys.Date())
Fetch all registered roles for a Norwegian legal entity. Returns one row per role assignment. Person-held roles include name and birth date. Entity-held roles (auditor firms, accountants) include the entity's organization number.
brreg_roles(org_nr)brreg_roles(org_nr)
org_nr |
Character. 9-digit organization number. |
Role types and groups are returned as English labels looked up from
the package's role_types and role_groups reference datasets.
Original Norwegian codes are preserved in role_code and
role_group_code.
A tibble with one row per role assignment. Columns:
org_nr, role_group, role_group_code, role, role_code,
first_name, middle_name, last_name, birth_date, deceased,
entity_org_nr, entity_name, resigned, deregistered,
ordering, elected_by, group_modified, person_id.
Returns an empty tibble if the entity has no registered roles.
The person_id column is a synthetic key composed of birth date, last
name, first name, and middle name. It enables network analysis across
companies but has a non-trivial collision risk for common Norwegian
names sharing a birth date. The brreg public API does not expose
national identity numbers.
brreg_board_summary() for derived board covariates,
role_types and role_groups for the English lookup tables.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
brreg_roles("923609016") # Equinor ASAbrreg_roles("923609016") # Equinor ASA
Reverse role lookup: find all entities where the given entity holds
a role (e.g. parent company, shareholder, general partner). This
is distinct from brreg_roles(), which returns who holds roles
IN the given entity.
brreg_roles_legal(org_nr)brreg_roles_legal(org_nr)
org_nr |
Character. 9-digit organization number. |
A tibble with one row per role held. Columns: org_nr
(queried entity), target_org_nr (entity where role is held),
target_name, role_code, role, share (ownership share
if applicable), resigned, deregistered.
brreg_roles() for who holds roles in an entity.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
brreg_roles_legal("923609016") # Equinor's roles in other entitiesbrreg_roles_legal("923609016") # Equinor's roles in other entities
Query the Central Coordinating Register by name, legal form, industry,
geography, and other criteria. Results are paginated automatically up to
max_results or the API's 10,000-result ceiling, whichever is lower.
brreg_search( name = NULL, legal_form = NULL, municipality_code = NULL, nace_code = NULL, min_employees = NULL, max_employees = NULL, bankrupt = NULL, parent_org_nr = NULL, max_results = 200, registry = c("enheter", "underenheter"), type = c("code", "label") )brreg_search( name = NULL, legal_form = NULL, municipality_code = NULL, nace_code = NULL, min_employees = NULL, max_employees = NULL, bankrupt = NULL, parent_org_nr = NULL, max_results = 200, registry = c("enheter", "underenheter"), type = c("code", "label") )
name |
Character. Entity name (partial match, case-insensitive). |
legal_form |
Character. Legal form code: |
municipality_code |
Character. 4-digit Norwegian municipality code. |
nace_code |
Character. NACE industry code (e.g. |
min_employees, max_employees
|
Integer. Employee count range. |
bankrupt |
Logical. If |
parent_org_nr |
Character. Filter to subsidiaries of this org. |
max_results |
Integer. Maximum entities to return (default 200).
The API caps search results at 10,000; use |
registry |
One of |
type |
A type of variables: |
A tibble with one row per entity. Column names follow the
package field dictionary (field_dict). An attribute total_matches
records the total number of matches in the registry.
Common codes for the legal_form parameter:
AS: Private limited company (like UK Ltd, German GmbH)
ASA: Public limited company (like UK PLC, German AG)
ENK: Sole proprietorship
NUF: Norwegian-registered foreign entity (branch office)
See legal_forms for the complete list with English translations.
brreg_entity() for single lookups,
brreg_label() for translating codes to English.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_underenheter(),
brreg_update_fields(),
brreg_updates()
# Search by name brreg_search(name = "Equinor") # Large private companies in Oslo brreg_search(legal_form = "AS", municipality_code = "0301", min_employees = 500, max_results = 10)# Search by name brreg_search(name = "Equinor") # Large private companies in Oslo brreg_search(legal_form = "AS", municipality_code = "0301", min_employees = 500, max_results = 10)
Produce period-level summary statistics from the snapshot store
for any combination of variables and summary functions. Returns
a tibble suitable for ggplot2 or as_brreg_tsibble() conversion.
brreg_series( .vars = NULL, .fns = list(total = function(x) sum(x, na.rm = TRUE)), by = NULL, frequency = c("year", "quarter", "month"), from = NULL, to = NULL, type = c("enheter", "underenheter", "roller"), label = FALSE )brreg_series( .vars = NULL, .fns = list(total = function(x) sum(x, na.rm = TRUE)), by = NULL, frequency = c("year", "quarter", "month"), from = NULL, to = NULL, type = c("enheter", "underenheter", "roller"), label = FALSE )
.vars |
Character vector of column names to aggregate.
|
.fns |
Named list of summary functions applied to each
column in |
by |
Character vector of grouping column names
(e.g. |
frequency |
One of |
from, to
|
Start and end dates for the panel. |
type |
One of |
label |
Logical. Translate group codes to English labels. |
A tibble with period (character), optional grouping
columns, and one column per variable-function combination.
Attribute brreg_panel_meta records metadata for
as_brreg_tsibble() conversion.
brreg_panel() for entity-level panels,
as_brreg_tsibble() for tsibble conversion.
Other tidybrreg panel functions:
as_brreg_tsibble(),
brreg_change_summary(),
brreg_changes(),
brreg_events(),
brreg_flows(),
brreg_panel(),
brreg_replay()
brreg_series(.vars = "employees", by = "legal_form") brreg_series(.vars = "employees", .fns = list(avg = mean, total = sum), by = "nace_1")brreg_series(.vars = "employees", by = "legal_form") brreg_series(.vars = "employees", .fns = list(avg = mean, total = sum), by = "nace_1")
Download today's complete register and save as a Parquet partition
in the local snapshot store. Each call adds one partition to a
Hive-partitioned dataset at
tools::R_user_dir("tidybrreg", "data")/{type}/snapshot_date={date}/.
Subsequent calls to brreg_panel() and brreg_events() query this
partitioned dataset lazily via arrow::open_dataset().
brreg_snapshot( type = c("enheter", "underenheter", "roller"), format = c("csv", "json"), date = Sys.Date(), force = FALSE, ask = interactive() )brreg_snapshot( type = c("enheter", "underenheter", "roller"), format = c("csv", "json"), date = Sys.Date(), force = FALSE, ask = interactive() )
type |
One of |
format |
Download format: |
date |
Date for this snapshot (default: today). Used as the partition key, not as an API parameter — the brreg bulk endpoint always returns the current-day state. |
force |
Logical. If |
ask |
Logical. If |
The file path to the written Parquet partition (invisibly).
brreg_import() to add historical snapshots from CSV files,
brreg_snapshots() to list available snapshots,
brreg_panel() to construct panels from accumulated snapshots.
Other tidybrreg snapshot functions:
brreg_cleanup(),
brreg_data_dir(),
brreg_import(),
brreg_manifest(),
brreg_open(),
brreg_snapshots()
brreg_snapshot() brreg_snapshots()brreg_snapshot() brreg_snapshots()
Scan the local snapshot store and return metadata for each partition.
brreg_snapshots(type = c("enheter", "underenheter", "roller"))brreg_snapshots(type = c("enheter", "underenheter", "roller"))
type |
One of |
A tibble with columns: snapshot_date (Date), file_size
(numeric, bytes), path (character).
Other tidybrreg snapshot functions:
brreg_cleanup(),
brreg_data_dir(),
brreg_import(),
brreg_manifest(),
brreg_open(),
brreg_snapshot()
brreg_snapshots()brreg_snapshots()
Inspects the snapshot store and download cache for each requested
dataset type. Used internally by brreg_network() to gate
depth > 1 operations that require local data for person-to-entity
reverse lookups.
brreg_status(datasets = c("enheter", "underenheter", "roller"), quiet = FALSE)brreg_status(datasets = c("enheter", "underenheter", "roller"), quiet = FALSE)
datasets |
Character vector of dataset types to check. |
quiet |
Logical. If |
A list with components: available (character vector of
datasets found locally), missing (character vector of datasets
not found), all_ready (logical).
brreg_snapshot() to download and cache bulk data,
brreg_download() for one-off downloads.
Other tidybrreg data management functions:
brreg_annotation_summary(),
brreg_annotations(),
brreg_sync(),
brreg_sync_status(),
diff_roller_state(),
read_changelog()
brreg_status()brreg_status()
Compute time-to-event and censoring indicators from entity
registration data, ready for use with survival::Surv() and
flexsurv.
brreg_survival_data( data, entry_var = "founding_date", censoring_date = Sys.Date() )brreg_survival_data( data, entry_var = "founding_date", censoring_date = Sys.Date() )
data |
A tibble from |
entry_var |
Column name for the entry date. Default
|
censoring_date |
Date at which surviving firms are right-censored. Default: today. |
A tibble with added columns: entry_date, exit_date
(Date or NA), duration_years (numeric), event (integer:
1 = exit observed, 0 = right-censored). Compatible with
survival::Surv(duration_years, event).
brreg_download() for full register data.
Other tidybrreg governance functions:
brreg_board_network(),
brreg_network()
firms <- brreg_search(legal_form = "AS", municipality_code = "0301", max_results = 100) surv <- brreg_survival_data(firms) surv[, c("org_nr", "entry_date", "exit_date", "duration_years", "event")]firms <- brreg_search(legal_form = "AS", municipality_code = "0301", max_results = 100) surv <- brreg_survival_data(firms) surv[, c("org_nr", "entry_date", "exit_date", "duration_years", "event")]
Maintains a local mirror of the Enhetsregisteret by applying incremental CDC (change data capture) events to a persistent state table. On first run, bootstraps from a bulk download. Subsequent runs poll the CDC endpoints from the last cursor position and apply mutations.
brreg_sync( types = c("enheter", "underenheter", "roller"), size = 10000L, roller_method = c("bulk", "cdc"), verbose = TRUE )brreg_sync( types = c("enheter", "underenheter", "roller"), size = 10000L, roller_method = c("bulk", "cdc"), verbose = TRUE )
types |
Character vector of streams to sync. Default syncs all four. |
size |
Integer. CDC page size per API call (max 10000). |
roller_method |
One of |
verbose |
Logical. Print progress messages. |
Four state files are maintained:
enheter.parquet — main entities (~1M rows)
underenheter.parquet — sub-entities (~500K rows)
roller.parquet — all roles (~3.4M rows)
paategninger.parquet — registry annotations
Every mutation is logged to a Hive-partitioned changelog
under state/changelog/sync_date={date}/. The changelog
drives brreg_changes() and brreg_flows().
A list with sync summary: events processed per type, changelog rows written, elapsed time.
Changelog is written first (WAL), then state files, then cursor. If a crash occurs between state and cursor, the next sync replays from the old cursor. Mutations are idempotent (upsert by org_nr), so replay is safe.
brreg_sync_status() to check current state,
brreg_changes() to query the changelog,
brreg_flows() for entry/exit counts.
Other tidybrreg data management functions:
brreg_annotation_summary(),
brreg_annotations(),
brreg_status(),
brreg_sync_status(),
diff_roller_state(),
read_changelog()
brreg_sync() brreg_sync_status()brreg_sync() brreg_sync_status()
Shows the current state of the sync engine: which state files exist, when the last sync occurred, cursor positions, and changelog size.
brreg_sync_status()brreg_sync_status()
A list with status components (invisibly).
brreg_sync() to run a sync,
brreg_changes() to query the changelog.
Other tidybrreg data management functions:
brreg_annotation_summary(),
brreg_annotations(),
brreg_status(),
brreg_sync(),
diff_roller_state(),
read_changelog()
brreg_sync_status()brreg_sync_status()
Convenience wrapper around brreg_search() that queries the
underenheter registry filtered by overordnetEnhet. Each Norwegian
legal entity that operates a business has one or more sub-units
(BEDR/AAFY) representing physical locations or activities.
brreg_underenheter(org_nr, max_results = 200, type = c("code", "label"))brreg_underenheter(org_nr, max_results = 200, type = c("code", "label"))
org_nr |
Character. 9-digit organization number of the parent entity (hovedenhet). |
max_results |
Integer. Maximum sub-units to return (default 200). |
type |
One of |
A tibble with one row per sub-unit. Same column schema as
brreg_search() with registry = "underenheter".
brreg_entity() for the parent entity,
brreg_children() for child enheter in the ORGL hierarchy.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_update_fields(),
brreg_updates()
brreg_underenheter("923609016")brreg_underenheter("923609016")
Returns one row per field-level change, plus one synthetic row for
each event that carries no field patches (Ny, Sletting, Fjernet).
Synthetic rows have operation = NA, field = NA,
new_value = NA, preserving event-level metadata in the output.
brreg_update_fields( since = Sys.Date() - 1, size = 100, max_pages = 1L, type = c("enheter", "underenheter"), verbose = FALSE )brreg_update_fields( since = Sys.Date() - 1, size = 100, max_pages = 1L, type = c("enheter", "underenheter"), verbose = FALSE )
since |
Date or POSIXct. Return updates after this timestamp. Defaults to yesterday. |
size |
Integer. Number of updates per page (max 10000). |
max_pages |
Integer. Maximum pages to fetch. Default 1. Set higher to paginate through large result sets automatically. |
type |
One of |
verbose |
Logical. Print page-level progress. |
To retrieve initial field values for newly registered entities
(change_type "Ny"), call brreg_entity() per org_nr — the CDC
payload for Ny events contains no field-level patches.
A tibble with columns: update_id, org_nr, change_type,
timestamp, operation, field, new_value. No list-columns.
Events without field patches (Ny, Sletting, Fjernet) appear as
rows with operation, field, and new_value all NA.
brreg_updates() for the event-level view.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_updates()
brreg_update_fields(since = Sys.Date() - 1, size = 50)brreg_update_fields(since = Sys.Date() - 1, size = 50)
Query the brreg change data capture (CDC) endpoint for entities
modified since a given date. Each update carries a monotonically
increasing update_id suitable for cursor-based pagination and
deduplication.
brreg_updates( since = Sys.Date() - 1, size = 100, max_pages = 1L, include_changes = FALSE, type = c("enheter", "underenheter", "roller"), verbose = FALSE )brreg_updates( since = Sys.Date() - 1, size = 100, max_pages = 1L, include_changes = FALSE, type = c("enheter", "underenheter", "roller"), verbose = FALSE )
since |
Date or POSIXct. Return updates after this timestamp. Defaults to yesterday. |
size |
Integer. Number of updates per page (max 10000). |
max_pages |
Integer. Maximum pages to fetch. Default 1. Set higher to paginate through large result sets automatically. |
include_changes |
Logical. If |
type |
One of |
verbose |
Logical. Print page-level progress. |
A tibble with columns: update_id, org_nr,
change_type, timestamp. If include_changes = TRUE, a
list-column changes with tibbles of operation, field,
new_value.
brreg_update_fields() for a flat alternative.
Other tidybrreg entity functions:
brreg_board_summary(),
brreg_children(),
brreg_download(),
brreg_entity(),
brreg_roles(),
brreg_roles_legal(),
brreg_search(),
brreg_underenheter(),
brreg_update_fields()
brreg_updates(since = Sys.Date() - 1, size = 10) # Auto-paginate brreg_updates(since = "2026-03-01", size = 10000, max_pages = 50, verbose = TRUE)brreg_updates(since = Sys.Date() - 1, size = 10) # Auto-paginate brreg_updates(since = "2026-03-01", size = 10000, max_pages = 50, verbose = TRUE)
Check whether organization numbers (organisasjonsnummer) pass the
modulus-11 check digit algorithm used by Norway's Central Coordinating
Register for Legal Entities. Valid numbers are exactly 9 digits, start
with 8 or 9, and have a correct check digit computed with weights
3, 2, 7, 6, 5, 4, 3, 2.
brreg_validate(org_nr)brreg_validate(org_nr)
org_nr |
Character vector of organization numbers to validate. |
Logical vector the same length as org_nr. TRUE for valid
numbers, FALSE otherwise.
brreg_entity() which validates before querying the API.
Other tidybrreg utilities:
brreg_label(),
get_brreg_dic()
brreg_validate(c("923609016", "984851006", "123456789", "999999999"))brreg_validate(c("923609016", "984851006", "123456789", "999999999"))
Pure function: takes two flattened roller tibbles (as produced by
flatten_roles() or parse_roles_bulk()) and returns a long-format
changelog recording every field-level mutation. Detects three
categories of change: role additions, role removals, and
field-level modifications on continuing roles.
diff_roller_state( old_state, new_state, timestamp = format(Sys.time(), "%Y-%m-%dT%H:%M:%S"), update_id = NA_integer_ )diff_roller_state( old_state, new_state, timestamp = format(Sys.time(), "%Y-%m-%dT%H:%M:%S"), update_id = NA_integer_ )
old_state |
Tibble. Previous roller state from
|
new_state |
Tibble. Current roller state from
|
timestamp |
Character or POSIXct. Timestamp for changelog entries (typically the CDC event time or sync time). |
update_id |
Integer or character. Identifier for the sync
batch, used as |
A tibble matching the changelog schema: timestamp,
org_nr, registry (always "roller"), change_type
("entry", "exit", "change"), field, value_from,
value_to, update_id.
Each role assignment is identified by
(org_nr, role_group_code, role_code, holder_id) where holder_id
is derived from person_id for person-held roles and
entity:{entity_org_nr} for entity-held roles (auditors,
accountants). Roles with neither are keyed as unknown:{row_index}
within their respective state — these are rare and produce
conservative add/remove pairs rather than false modifications.
For additions, fields that are NA in the new state are excluded
from the changelog (no value to report). For removals, fields that
are NA in the old state are excluded. For modifications, a change
from NA to a non-NA value (or vice versa) is recorded.
brreg_sync() for automated sync with changelog persistence,
brreg_roles() for fetching current roles,
brreg_changes() for querying stored changelogs.
Other tidybrreg data management functions:
brreg_annotation_summary(),
brreg_annotations(),
brreg_status(),
brreg_sync(),
brreg_sync_status(),
read_changelog()
# Detect board changes for a single company old <- brreg_roles("923609016") Sys.sleep(1) new <- brreg_roles("923609016") diff_roller_state(old, new) # Bootstrap: NULL old state treats all roles as entries roles <- brreg_roles("923609016") diff_roller_state(NULL, roles)# Detect board changes for a single company old <- brreg_roles("923609016") Sys.sleep(1) new <- brreg_roles("923609016") diff_roller_state(old, new) # Bootstrap: NULL old state treats all roles as entries roles <- brreg_roles("923609016") diff_roller_state(NULL, roles)
A tibble mapping brreg JSON field paths to English column names and R types. Used internally by the parse engine. API fields absent from this dictionary pass through with auto-generated snake_case names rather than being silently dropped.
field_dictfield_dict
A tibble with 103 rows and 3 columns:
Dot-notation path in the brreg JSON response
(e.g. "organisasjonsnummer", "forretningsadresse.kommune").
English column name used in package output
(e.g. "org_nr", "municipality").
R type for coercion: "character", "Date",
"integer", "numeric", or "logical".
brreg_entity() for the function that uses this dictionary.
Other tidybrreg reference data:
annotation_infotypes,
legal_forms,
role_groups,
role_types
field_dict field_dict[field_dict$type == "Date", ]field_dict field_dict[field_dict$type == "Date", ]
Retrieve English or Norwegian label dictionaries for NACE industry codes or institutional sector codes. Dictionaries are cached in a session-level environment (following the eurostat package pattern). Bundled data is used as fallback when the SSB Klass API is unreachable.
get_brreg_dic(dictname = c("nace", "sector"), lang = "en")get_brreg_dic(dictname = c("nace", "sector"), lang = "en")
dictname |
One of |
lang |
|
A tibble with columns code, name_en, level.
brreg_label() for translating columns in place.
Other tidybrreg utilities:
brreg_label(),
brreg_validate()
get_brreg_dic("nace") get_brreg_dic("sector")get_brreg_dic("nace") get_brreg_dic("sector")
All organisasjonsformer registered with the Brønnøysund Register Centre, with English translations. Fetched from the brreg API during package build and supplemented with manual English translations.
legal_formslegal_forms
A tibble with 44 rows and 4 columns:
Legal form code (e.g. "AS", "ASA", "ENK").
Norwegian description.
Date string if the form is expired, NA otherwise.
English translation.
brreg_label() to translate legal form codes in entity data.
Other tidybrreg reference data:
annotation_infotypes,
field_dict,
role_groups,
role_types
legal_forms legal_forms[legal_forms$code == "AS", ]legal_forms legal_forms[legal_forms$code == "AS", ]
Maps brreg rollegruppe codes to English names.
role_groupsrole_groups
A tibble with 15 rows and 3 columns:
Role group code (e.g. "STYR", "DAGL", "REVI").
English translation (e.g. "Board of Directors").
Norwegian description.
Other tidybrreg reference data:
annotation_infotypes,
field_dict,
legal_forms,
role_types
role_groupsrole_groups
Maps brreg rolle codes to English names. Used by brreg_roles() for
automatic role labelling and by brreg_label() for post-hoc
translation.
role_typesrole_types
A tibble with 18 rows and 3 columns:
Role code (e.g. "LEDE", "MEDL", "DAGL").
English translation (e.g. "Chair of the Board").
Norwegian description.
Other tidybrreg reference data:
annotation_infotypes,
field_dict,
legal_forms,
role_groups
role_typesrole_types