Skip to content
Prev 383914 / 398502 Next

Date from text

On Fri, 15 May 2020, Poizot Emmanuel writes:
If you really want a date, I'd suggest 'as.Date'. The help
for ?as.Date says:

  "If the date string does not specify the date completely,
   the returned answer may be system-specific."

So perhaps try something like

    as.Date(paste0("01-", "11-1993"), format = "%d-%m-%Y")
    ## [1] "1993-11-01"

Or look at 'yearmon' in package 'zoo':

    library("zoo")
    as.yearmon("11-1993", format = "%m-%Y")
    ## [1] "Nov 1993"
Message-ID: <87blmpv2al.fsf@enricoschumann.net>
In-Reply-To: <b2831f71-d154-dc16-5044-af4335123fbe@lecnam.net> (Poizot Emmanuel's message of "Fri, 15 May 2020 11:38:31 +0200")