From dietm@r@schi@dler m@ili@g off m@@rol@@d-web@com  Tue Jul 31 13:09:58 2018
From: dietm@r@schi@dler m@ili@g off m@@rol@@d-web@com (dietm@r@schi@dler m@ili@g off m@@rol@@d-web@com)
Date: Tue, 31 Jul 2018 11:09:58 +0000
Subject: [Rd] RFC: make as.difftime more consistent or convenient
Message-ID: <5fdb1151361a4e7c9677ca4e3bc4f338@AUSMXMBX04.mrws.biz>

Hello!

I notice I can convert strings containing hour, minute or second specifications to a 'difftime':

> as.difftime("12 h", "%H")
Time difference of 12 hours
> as.difftime("12 m", "%M")
Time difference of 12 mins
> as.difftime("12 s", "%S")
Time difference of 12 secs

But I can't do so with a week specification, because there is no appropriate format ..., although "weeks" is a legitimate unit of 'difftime':

> as.difftime("12 w", "%...")

1. What do you think about making the behavior of 'as.difftime' more consistent by accepting also formats for "days" and "weeks"?

2. Even more convenient it could be if 'as.difftime' accepted strings containing magnitude and unit; how about:

> as.difftime("12 weeks")
Time difference of 12 weeks

--
Regards,
Dietmar Schindler
________________________________
manroland web systems NewCo GmbH | Managing Director: Alexander Wassermann
Registered Office: Augsburg | Trade Register: AG Augsburg | HRB-No.: 32609 | VAT: DE815764857

Confidentiality note:
This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, then please delete this eMail.



[Rd] RFC: make as.difftime more consistent or convenient
dietm@r@schi@dler m@ili@g off m@@rol@@d-web@com