Skip to content

SwissStatsR/noga

Repository files navigation

noga

R-CMD-check

The noga package allows recoding noga values to their labels or vice versa. Noga is derived from the European classification system of economic activities (NACE). NOGA08 is the version currently supported in this package.

Installation

You can install the noga package from GitHub with:

# install.packages("devtools")
devtools::install_github("swissstatsr/noga")

The package is not yet available on CRAN.

NOGA-levels

The Noga classification system has 5 levels which can be recoded with this package:

  • section (a single alphabetic character from A to U)
  • division (two digits 01-99)
  • group (three digits 011-990)
  • class (four digits 0111-9900)
  • type (six digits 011100-990003)

Note that if you recode labels to values, the output variable will be in string format as the noga codes are essentially strings rather than a numeric.

Usage

The function noga::noga_recode() recodes noga values to their labels or vice versa. Please note that the vector/variable you recode cannot contain multiple noga levels simultaneously. The function will not be able to recode a vector that contains both the noga-group and noga-class level. If all given labels are shared across several levels, the deepest (most specific) level will be used.

library(noga)

example.data <- data.frame(
  test1 = c(702, 62),
  test2 = c("Management consultancy activities", "Extraction of natural gas"),
  test3 = c("702", "062")
)

noga_recode(var=example.data$test1, language = "fr", level = "group", to = "auto")
#> [1] "Conseil de gestion"        "Extraction de gaz naturel"
noga_recode(var=example.data$test2, language = "en", level = "auto", to = "values")
#> [1] "702" "062"
noga_recode(var=example.data$test3, language = "de", level = "auto", to = "auto")
#> [1] "Public-Relations- und Unternehmensberatung"
#> [2] "Gewinnung von Erdgas"

Planned expansion for the future

  • Aggregation function so that values/codes of a depper level can be aggregated to a higher one
  • Include economic sectors (primary: raw material, secondary: manufacturing, tertiary: services)
  • Include the Noga-50 level of the Swiss FSO that groups Switzerland’s largest divisions so that they represent the 50 economic activities
  • When available, include NOGA 2025 recoding (to/from labels and codes, to/from NOGA08)

About

R Package to recode noga values and labels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages