[Rd] as.Date.character suggestion
pdalgd at gmail.com
Thu Aug 21 09:28:34 CEST 2014
On 21 Aug 2014, at 02:21 , Gabriel Becker <gmbecker at ucdavis.edu> wrote:
> Ah, my mistake, I read too fast. (My code is also wrong, embarassingly).
> It seems like it's behavior when you pass it "" is simply a bug, then.
> Sorry for the noise,
It's not a bug, it's just that you are at the mercy of strptime() if you do specify a format. If the format doesn't contain a conversion for some component, you get the value corresponding to the current date and leftover characters are just ignored, e.g.
and the extreme case is that a "" format gives current date, whatever the input. On Mac OSX Mavericks anyway --- this stuff is system-dependent.
So I think Peter Langfelder is absolutely right, remove the default, which is never used anyway, and possibly update the documentation with a more direct reference to strptime(). This should have near-zero effect on the semantics.
> On Wed, Aug 20, 2014 at 4:59 PM, Peter Langfelder <
> peter.langfelder at gmail.com> wrote:
>> On Wed, Aug 20, 2014 at 4:52 PM, Gabriel Becker <gmbecker at ucdavis.edu>
>>> Could do both to preserve bc...
>>> if(missing(format) || !nchar(format))
>> No, the problem is that the function behaves differently when format
>> is missing than when it equals its default. Removing this difference
>> necessarily changes behaviour and hence (at least in principle) breaks
>> backward compatibility.
> Gabriel Becker
> Graduate Student
> Statistics Department
> University of California, Davis
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-devel