Re: [R] Unexpected date format coercion

2021-07-01 Thread Enrico Schumann
On Thu, 01 Jul 2021, Jeremie Juste writes: > Hello > > On Thursday, 1 Jul 2021 at 08:25, PIKAL Petr wrote: >> Hm. >> >> Seems to me, that both your codes are wrong but printing in Linux is >> different from Windows. >> >> With >> as.Date("20-12-2020","%Y-%m-%d") >> you say that 20 is year

Re: [R] Unexpected date format coercion

2021-07-01 Thread PIKAL Petr
Juste > Sent: Thursday, July 1, 2021 11:00 AM > To: PIKAL Petr > Cc: r-help > Subject: Re: [R] Unexpected date format coercion > > Hello > > On Thursday, 1 Jul 2021 at 08:25, PIKAL Petr wrote: > > Hm. > > > > Seems to me, that both your codes are wrong but

Re: [R] Unexpected date format coercion

2021-07-01 Thread Jeremie Juste
Hello On Thursday, 1 Jul 2021 at 08:25, PIKAL Petr wrote: > Hm. > > Seems to me, that both your codes are wrong but printing in Linux is > different from Windows. > > With > as.Date("20-12-2020","%Y-%m-%d") > you say that 20 is year (actually year 20) and 2020 is day and only first > two values

Re: [R] Unexpected date format coercion

2021-07-01 Thread PIKAL Petr
I can confirm 4.0.3 in Windows behaves this way too. > as.Date("20-12-2020","%Y-%m-%d") [1] "0020-12-20" Cheers Petr > -Original Message- > From: R-help On Behalf Of Jeremie Juste > Sent: Thursday, July 1, 2021 10:06 AM > To: r-help > Subje

Re: [R] Unexpected date format coercion

2021-07-01 Thread Jim Lemon
Hi Jeremie, Try: as.Date("20-12-2020","%y-%m-%d") [1] "2020-12-20" Jim On Thu, Jul 1, 2021 at 6:16 PM Jeremie Juste wrote: > > Hello, > > I have been surprised when converting a character string to a date with the > following > format, > > in R 4.1.0 (linux debian 10) > >

Re: [R] Unexpected date format coercion

2021-07-01 Thread Uwe Ligges
On 01.07.2021 10:06, Jeremie Juste wrote: Hello, I have been surprised when converting a character string to a date with the following format, in R 4.1.0 (linux debian 10) as.Date("20-12-2020","%Y-%m-%d") [1] "20-12-20" in R 4.0.5 (window 10) as.Date("20-12-2020","%Y-%m-%d") [1]

[R] Unexpected date format coercion

2021-07-01 Thread Jeremie Juste
Hello, I have been surprised when converting a character string to a date with the following format, in R 4.1.0 (linux debian 10) as.Date("20-12-2020","%Y-%m-%d") [1] "20-12-20" in R 4.0.5 (window 10) as.Date("20-12-2020","%Y-%m-%d") [1] "0020-12-20" Here I was expecting a blunt and sharp