September trouble [🇷 for BE/BA]

posted by ElMaestro  – Denmark, 2025-11-10 13:26 (205 d 09:51 ago) – Posting: # 24483
Views: 2,913

(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,653 posts in 4,991 threads, 1,571 registered users;
179 visitors (0 registered, 179 guests [including 36 identified bots]).
Forum time: 00:17 CEST (Europe/Vienna)

There are in fact two things, science and opinion;
the former begets knowledge, the latter ignorance.    Hippocrates

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