Turn character vector into factor with proper fhx levels

make_rec_type(x)

Arguments

x

A character vector or factor containing one or more rec_type-like strings. This uses a controlled vocabulary, see burnr:::rec_type_all for list of all possible rec_type values.

Value

A factor with appropriate fhx levels.

See also

  • fhx() constructs an fhx object.

  • as_fhx() casts data frame-like objects into fhx objects.

Examples

make_rec_type("null_year")
#> [1] null_year
#> 29 Levels: null_year recorder_year unknown_fs unknown_fi ... latelw_fi

make_rec_type(c("null_year", "late_fs"))
#> [1] null_year late_fs  
#> 29 Levels: null_year recorder_year unknown_fs unknown_fi ... latelw_fi