nor_locations_hierarchy_from_to: Location hierarchies in Norway

View source: R/nor_locations_hierarchy.R

nor_locations_hierarchy_from_toR Documentation

Location hierarchies in Norway

Description

Returns a mapping between two geographic levels in Norway. Both from and to accept character vectors, in which case all requested combinations are returned combined into a single data.table.

Usage

nor_locations_hierarchy_from_to(
  from,
  to,
  include_to_name = FALSE,
  border = csdata::config$border_nor
)

Arguments

from

Character vector. The source geographic granularity. One or more of: "wardoslo", "extrawardoslo", "wardbergen", "wardtrondheim", "wardstavanger", "missingwardoslo", "missingwardbergen", "missingwardtrondheim", "missingwardstavanger", "municip", "baregion", "county", "georegion", "mtregion", "notmainlandmunicip", "notmainlandcounty", "missingmunicip", "missingcounty".

to

Character vector. The target geographic granularity. Same valid values as from.

include_to_name

Logical. If TRUE, include the name of each to location as a third column to_name. Default FALSE.

border

Integer. The geographic border year. Valid values: 2024. Defaults to csdata::config$border_nor.

Value

A data.table with columns:

from_code

Location code at the from granularity level.

to_code

Location code at the to granularity level.

to_name

Name of the to location (only present when include_to_name = TRUE).

Examples

csdata::nor_locations_hierarchy_from_to(from = "wardoslo", to = "county")
csdata::nor_locations_hierarchy_from_to(from = "municip", to = "baregion")
csdata::nor_locations_hierarchy_from_to(
  from = c("municip", "county"),
  to   = "georegion",
  include_to_name = TRUE
)

csdata documentation built on July 3, 2026, 1:07 a.m.