September trouble [🇷 for BE/BA]

posted by ElMaestro  – Denmark, 2025-11-10 13:26 (225 d 04:03 ago) – Posting: # 24483
Views: 3,032

(edited on 2025-11-10 13:42)

Hi all,

can someone try this:

Date.str=paste0("01/", month.abb[c(1:12)], "/2024")
Date.I=as.Date(Date.str,format='%d/%b/%Y')
print(data.frame(Date.str, Date.I))

The code creates some dates as string for first day of all months and then tries to interpret the strings as dates. I am getting an NA for September.

Oddly, if I abbreviate September as "Sept" rather then "Sep"
as.Date("01/Sept/2024",format='%d/%b/%Y')

then it works, in spite of the fact that month.abb[9] is Sep and not Sept on my system.:-|

Does it behave the same way on your system? Mine is Win11 installed last week along with a fresh R install.

Add.: Oh dear, is %b locale-dependent? Shoot me, please. Put me out of my misery. This is not good.

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,571 registered users;
124 visitors (0 registered, 124 guests [including 17 identified bots]).
Forum time: 18:29 CEST (Europe/Vienna)

Competence, like truth, beauty and contact lenses,
is in the eye of the beholder.    Laurence J. Peter

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5