From msuzen at gmail.com  Thu Mar  9 08:05:03 2017
From: msuzen at gmail.com (Suzen, Mehmet)
Date: Thu, 9 Mar 2017 08:05:03 +0100
Subject: [Rd] as.POSIXct behaviour
In-Reply-To: <CAJ=vYTFX25JxhXBzYbVo7qu=WDYc7UHWqjb+tmgqT_GUM6HUhQ@mail.gmail.com>
References: <CAJ=vYTFX25JxhXBzYbVo7qu=WDYc7UHWqjb+tmgqT_GUM6HUhQ@mail.gmail.com>
Message-ID: <CAPtbhHyaJZBS0xoRNur9SsTiF+vQt5W3KCorVhuSJmA_=upgkQ@mail.gmail.com>

On 9 March 2017 at 01:29, Arunkumar Srinivasan
<arunkumar.sriniv at gmail.com> wrote:
> The time info is lost on the first index as well. And it happens *silently*.

Yes, because it assumes homogeneous format on the entire vector.  You
may want to
do  two passes with different formats or run a regular expression to
catch typos.

> lapply(x, as.POSIXct)
> A list is returned, but values are as I?d expect. Would it be possible
> to retain the time info with as.POSIXct(x) directly as well? If not,

This behaves differently because you are running as.POSIXct for each element
separately.



[Rd] as.POSIXct behaviour
Suzen, Mehmet