linelist icon indicating copy to clipboard operation
linelist copied to clipboard

Error thrown for an empty variable (only NAs)

Open aspina7 opened this issue 5 years ago • 1 comments

Hello friends - was trying to run guess_dates over one of several date variables. Turns out one was empties, initial as a logical var, so switched it to a char and still got error thrown (see reprex). Thanks!

test_df <- dplyr::tibble(empty_var = as.character(c(NA, NA, NA, NA, NA)))
test_df
#> # A tibble: 5 x 1
#>   empty_var
#>   <chr>    
#> 1 <NA>     
#> 2 <NA>     
#> 3 <NA>     
#> 4 <NA>     
#> 5 <NA>
linelist::guess_dates(test_df$empty_var)
#> Error in if (prop_successful < (1 - error_tolerance)) {: missing value where TRUE/FALSE needed

Created on 2020-02-10 by the reprex package (v0.3.0)

aspina7 avatar Feb 10 '20 14:02 aspina7

I'll see what I can do.

zkamvar avatar Feb 10 '20 15:02 zkamvar