From dd@|thorp @end|ng |rom protonm@||@com  Wed Nov  2 13:30:43 2022
From: dd@|thorp @end|ng |rom protonm@||@com (Dan Dalthorp)
Date: Wed, 02 Nov 2022 12:30:43 +0000
Subject: [Rd] as.Date without "origin"
Message-ID: <EKNZOOr0Xk-P1uT_HZiKSmlTniaWJ9qxbkQAdiT-WTIadalBDTvhObEvUFCj_yZEXiO1_mImOaOMtS-gxB3Rc5rcCUyeUZY9KTpuq-Yd89U=@protonmail.com>

The new (2022-10-11 r83083 ucrt) as.Date function returns a date rather than an error when called without "origin" specified.

# previous versions of R
as.Date(0)
# Error in as.Date.numeric(0) : 'origin' must be supplied

# new:
as.Date(0)
# [1] "1970-01-01"

This is at odds with the help file, which gives:

origin

aDateobject, or something which can be coerced byas.Date(origin, ...)to such an object.

And:
as.Datewill accept numeric data (the number of days since an epoch), butonlyiforiginis supplied.

The behavior described in the help file and implemented in previous versions seems more reasonable than returning a date with an arbitrary "origin". In any case, in the r-devel there is a mismatch between the function and its description.

-Dan
	[[alternative HTML version deleted]]



[Rd] as.Date without "origin"
Dan Dalthorp