join_abolished_mun: Join abolished municipalities

View source: R/join_abolished_mun.R

join_abolished_munR Documentation

Join abolished municipalities

Description

Takes a vector of municipality codes with KU-prefixes and transforms the codes of the abolished municipalities to the codes of the municipality to which they have joined.

Usage

join_abolished_mun(x, col = NULL)

Arguments

x

an object containing municipality codes, a vector, a factor or a data.frame.

col

name of column in case input is data.frame

Value

vector, factor or data.frame, depending on input.

Examples


  v <- c("KU414", "KU609", "KU429", "KU272")
  join_abolished_mun(x = v)
  f <- factor(c("KU414", "KU609", "KU429", "KU272"))
  join_abolished_mun(f)
  df <- data.frame(kunta_code =  c("KU414", "KU609", "KU429", "KU272"), values = rnorm(4))
  join_abolished_mun(df, "kunta_code")
  df <- data.frame(kunta_code =  factor(c("KU414", "KU609", "KU429", "KU272")), values = rnorm(4))
  join_abolished_mun(df, "kunta_code")


pttry/statficlassifications documentation built on Sept. 17, 2024, 12:10 p.m.