How to convert 20210305 to 2021-03-05 in R?

I have downloaded google analytics csv file where date is shown like this - 20210305. I want to convert this in this format yyyy-mm-dd e.g.(2021-03-05) for logical comparison. How can I convert my csv file's entire date column in this format yyyy-mm-dd

Since you have tagged tidyverse you can use lubridate::ymd() function.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.