Your original dates are not in an unambiguous format, so it is better to explicitly define the date format, I would say you should take a more individualized approach for both described cases:
Hi, thanks! It works. But it shows me this message:
"
Warning messages:
1: Problem while computing `column = if_else(...)`.
i 221 failed to parse.
2: Problem while computing `column = if_else(...)`.
i NAs introduced by coercion
"
Should I be worried?
Also, i try with this way very similar and it works:
This seems like a bug to me, both commands are being evaluated on the complete dataset regardless of the logical condition but at the end you get the desired result so I would say that you should not be worried.
Yes, it works, I simply didn't want to install an additional package (janitor) just for one function, that is why I did the same thing using base R.
I am looking more carefully and I notice that the dates have been changed so that the year is first, and then the month and then the day, even when I have set it to be dmy(). and I can't change it.
it looks like this:
That function is reading dates in that format not converting them to it
No, it has nothing to do with the warning message, that format is the ISO standard and is the only way to have actual dates in R, if you change the format to anything else the column is converted to character class. Have in mind that you can always change the date format in your output for presentation purposes like in tables (not data frames) and plots.