Since you are loading lubridate it is enough to do

Atest$ddate1 <- dmy(Atest$ddate)



On Sun, Jun 9, 2024 at 11:59 PM Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
>
> On 2024-06-09 4:39 p.m., Val wrote:
> > HI all,
> >
> > My
> > I am trying to convert character date (mm/dd/yy)  to YYYY-mm-dd date
> > format in one of the columns of my data file.
> >
> > The first few lines of the data file looks like as follow
> >
> >   head(Atest,10);dim(Atest)
> >        ddate
> > 1  19/08/21
> > 2  30/04/18
>
> Those aren't legal months in the first entry.  Your format looks like it
> should be "%d/%m/%y".
>
> Duncan Murdoch
>
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to