Skip to contents

Convert ASCED fields of education into the consistent format used by the Australian Bureau of Statistics. This function enables both exact (default) and fuzzy matching. Under exact matching, if no match is found, NA is returned.

Usage

clean_asced_foe(
  x,
  fuzzy_match = FALSE,
  max_dist = 0.4,
  method = "jw",
  silent = FALSE
)

Arguments

x

a (character) vector containing ASCED fields of education. Note that clean_asced_foe always returns a character vector. If no match is found, then NA is returned.

fuzzy_match

logical; either TRUE which indicates that approximate/fuzzy string matching should be used, or FALSE (the default) which indicates that only exact matches should be used. If FALSE, then if no match is found, then NA is returned.

max_dist

numeric, sets the maximum acceptable distance between your string and the matched string. Default is 0.4. Only relevant when fuzzy_match is TRUE.

method

the method used for approximate/fuzzy string matching. Default is "jw", the Jaro-Winker distance; see `??stringdist-metrics` for more options. Only relevant when fuzzy_match is TRUE.

silent

a boolean value. If FALSE (the default), the function will warn that NAs were returned.

Value

a character vector

See also

clean_asced_qual for ASCED levels, clean_anzsco for ANZSCO, clean_anzsic for ANZSIC, clean_state for Australian states and territories.

Other cleaning functions: clean_anzsco(), clean_anzsic(), clean_asced_qual(), clean_nfd()

Examples


clean_asced_foe("Biochemistry & cell biology")
#> [1] "Biochemistry and Cell Biology"

clean_asced_foe("Maths", fuzzy_match = TRUE)
#> [1] "Mathematical Sciences"