Skip to contents

[Experimental]

This function validates cpfs by calculating of the check digits

Usage

validate_cpf(.data, .cpf, .fix_cpf = TRUE, .clear_steps = TRUE)

Arguments

.data

data frame

.cpf

cpf variable

.fix_cpf

fix_cpf()

.clear_steps

delete the variables used to validate cpfs

Examples


data.frame(
 cpf = c(
   "22233344",
   "423.643.534-29",
   "458.613.523-23",
   13434563434,
   NA
   )
 ) -> data
 validate_cpf(data, cpf)
#> # A tibble: 5 × 3
#>   cpf            cpf_id cpf_check
#>   <chr>           <int> <chr>    
#> 1 000.222.333-44      1 invalid  
#> 2 423.643.534-29      2 invalid  
#> 3 458.613.523-23      3 invalid  
#> 4 134.345.634-34      4 invalid  
#> 5 NA                  5 unknown