I have this column that is a mixture of "NO" and numbers that are really just badly imported dates.
Is there any way to keep the "NO" but modify the numbers to be the correct date?
# A tibble: 114.167 × 1
hpv_pre_fecha
<chr>
1 NO
2 NO
3 NO
4 41064
5 NO
6 NO
7 NO
8 NO
9 NO
10 41019
I tried this code but it didnt work:
base %>%
select(hpv_pre_fecha) %>%
mutate(hpv_pre_fecha2= if_else(str_detect(hpv_pre_fecha,
"[:punct:]"),
hpv_pre_fecha %>%
as.numeric() %>%
excel_numeric_to_date() %>%,
.))