Skip to contents

Philippine Standard Occupational Classification (PSOC)

Usage

get_psoc(
  ...,
  token = NULL,
  version = NULL,
  level = NULL,
  harmonize = TRUE,
  minimal = TRUE,
  cols = NULL
)

Arguments

...

See ?dplyr::filter. Expressions that return a logical value, and are defined in terms of the variables in returned data. If multiple expressions are included, they are combined with the & operator. Only rows for which all conditions evaluate to TRUE are kept.

token

Character. API access token.

version

Character. Version of the PSOC dataset. Default is NULL. If NULL, the latest version is used.

level

Character. Classification level such as "all", "major", "sub-major", "minor", and "unit".

harmonize

Logical. If TRUE, formats and standardizes the returned data. Default is TRUE.

minimal

Logical. If TRUE, returns a simplified dataset. Default is TRUE.

cols

Optional. Character vector of additional columns to include when minimal = FALSE.

Value

A data frame of PSOC classifications.

Examples

if (FALSE) { # \dontrun{
get_psoc(token = "your_api_token")
} # }
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
psoc <- get_psoc()

# Get specific level
psoc_filtered <- get_psoc(level = "major")
psoc_filtered
#> # A tibble: 10 × 2
#>    value label                                             
#>    <int> <chr>                                             
#>  1     1 Managers                                          
#>  2     2 Professionals                                     
#>  3     3 Technicians and associate professionals           
#>  4     4 Clerical support workers                          
#>  5     5 Service and sales workers                         
#>  6     6 Skilled agricultural, forestry and fishery workers
#>  7     7 Craft and related trades workers                  
#>  8     8 Plant and machine operators, and assemblers       
#>  9     9 Elementary occupations                            
#> 10     0 Armed forces occupations