Skip to contents

Check sex values in cause-of-death data based on CoDEdit rules

Usage

cod_check_sex(sex_value, sex_code = c(1, 2))

Arguments

sex_value

An integer value or vector of values for age based on the CoDEdit rules.

sex_code

A character or integer vector of 2 values that indicate which values are to be considered pertaining to males (first value in the vector) or to females (second value in the vector). Default is 1 for male and 2 for female.

Value

A tibble with number of rows equal to length of sex_value and two columns for sex_check and sex_check_note.

Examples

cod_check_sex("m", c("m", "f"))
#> # A tibble: 1 × 2
#>   sex_check sex_check_note          
#>       <int> <fct>                   
#> 1         0 No issues with sex value
cod_check_sex("male", c("male", "female"))
#> # A tibble: 1 × 2
#>   sex_check sex_check_note          
#>       <int> <fct>                   
#> 1         0 No issues with sex value
cod_check_sex(1, 1:2)
#> # A tibble: 1 × 2
#>   sex_check sex_check_note          
#>       <int> <fct>                   
#> 1         0 No issues with sex value