From Ach|m@Ze||e|@ @end|ng |rom u|bk@@c@@t  Sun Dec  6 13:10:29 2020
From: Ach|m@Ze||e|@ @end|ng |rom u|bk@@c@@t (Achim Zeileis)
Date: Sun, 6 Dec 2020 13:10:29 +0100 (CET)
Subject: [Rd] as.POSIXct.numeric change default of origin argument
In-Reply-To: <CAOO9MKUcye7E00SBEGWMQpCR-Z9q6yAdM0nM=QqRqb8T8jfRbA@mail.gmail.com>
References: <CAOO9MKUcye7E00SBEGWMQpCR-Z9q6yAdM0nM=QqRqb8T8jfRbA@mail.gmail.com>
Message-ID: <e31ea570-3ca6-dcc7-4b95-e46f66b8a849@uibk.ac.at>

On Sun, 6 Dec 2020, Jan Gorecki wrote:

> Hello all,
>
> I would like to propose to change the default value for "origin"
> argument in as.POSIXct.numeric method, from current missing to new
> "1970-01-01".
> My proposal is motivated by the fact that this is the most commonly
> needed value for "origin" argument and having that as a default seems
> reasonable.
> Proposed change seems to be pretty safe because it is now an error.

I would also be in favor of this (and have been for years), mostly to make 
it consistent with the as.numeric() method. Same for "Date".

To support the latter, the "zoo" package provides a separate as.Date() 
generic that enables the as.Date.numeric() with different default.

The main argument of R Core against it is that it is too uncertain whether 
the origin is really 1970-01-01, e.g., when importing from Excel or SAS.

Best wishes,
Z

> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] as.POSIXct.numeric change default of origin argument
Achim Zeileis