The downloaded file of geo codes for specific year from SSB is saved in csv format. The codes that have changed are copied from Endringer tab and pasted into an Excel file. The .csv and .xlsx files will than be merged by running this function.

geo_set(
  grep.file = NULL,
  grep.change = NULL,
  year = NULL,
  type = c("land", "fylke", "kommune", "bydel", "grunnkrets"),
  folder.path = NULL,
  filegeo = NULL,
  filechg = NULL
)

Arguments

grep.file

Common file name for the selected period eg. "jan2019"

grep.change

Common name for xlsx file for code change eg. "change"

year

Year of the selected code list

type

Type of regional granularity ie. fylke, kommune etc.

folder.path

Folder path to the files

filegeo

Specify csv file for geocode if grep.file is empty

filechg

Specify xlsx file name and location if grep.change is empty

Details

The following dataset will be generated:

  • data : The whole merged dataset

  • xl : The xlsx file

  • change : Path where the change file is if raw = FALSE

  • code : Path where the csv file is if raw = FALSE

  • type : The granularity level