Skip to contents

This function translates a vector of 4-digit ISCO88 codes to ISCO68 codes using the translation table stored in all_schema$isco88_to_isco68.

Usage

isco88_to_isco68(x, label = FALSE, to_factor = FALSE)

Arguments

x

A character vector of 4-digit ISCO codes.

label

A logical value indicating whether to return the labels of the translated ISCO68 codes (default is FALSE).

to_factor

A logical value indicating whether to return a factor instead of a character. The order of the labels is taken from the labels for ISCO68 found in all_labels (default is FALSE).

Value

A character vector of ISCO68 codes.

Details

This translation was taken from the iscogen Stata package. For more details, check out the package documentation and search for ISCO88 -> ISCO68.

Examples

library(dplyr)

# isco88
ess %>%
  transmute(
    isco88,
    isco68 = isco88_to_isco68(isco88, label = FALSE),
    isco68_label = isco88_to_isco68(isco88, label = TRUE)
  )
#> # A tibble: 48,285 × 3
#>    isco88 isco68 isco68_label           
#>    <chr>  <chr>  <chr>                  
#>  1 5169   5890   'PROT SERV WRKRS NEC'  
#>  2 1222   2120   'FACTORY MANAGER'      
#>  3 8120   7200   'METAL PROCESSORS'     
#>  4 7141   9310   'CONSTR PAINTERS'      
#>  5 6111   6220   'FIELD CROP WRKR'      
#>  6 6111   6220   'FIELD CROP WRKR'      
#>  7 9313   9595   'UNSKLLD CONSTRCT WRKR'
#>  8 1221   6000   'FARM MANAGERS'        
#>  9 1221   6000   'FARM MANAGERS'        
#> 10 6111   6220   'FIELD CROP WRKR'      
#> # ℹ 48,275 more rows