From josh.m.ulrich at gmail.com  Wed Feb 24 18:02:29 2016
From: josh.m.ulrich at gmail.com (Joshua Ulrich)
Date: Wed, 24 Feb 2016 11:02:29 -0600
Subject: [Rd] %OS on output
In-Reply-To: <2092113649.1876381.1456332053631.JavaMail.yahoo@mail.yahoo.com>
References: <2092113649.1876381.1456332053631.JavaMail.yahoo.ref@mail.yahoo.com>
	<2092113649.1876381.1456332053631.JavaMail.yahoo@mail.yahoo.com>
Message-ID: <CAPPM_gTU-6D2nEc0AkU0Q_hCyhMqofz5sNEH0ngf0GXAx9NvNQ@mail.gmail.com>

On Wed, Feb 24, 2016 at 10:40 AM, Suharto Anggono Suharto Anggono via
R-devel <r-devel at r-project.org> wrote:
> R help on 'strptime' has the following in "Details" section.
> Specific to R is ?%OSn?, which for output gives the seconds truncated to ?0 <= n <= 6? decimal places (and if ?%OS? is not followed by a digit, it uses the setting of ?getOption("digits.secs")?, or if that is unset, ?n = 3?).
>
> In reality, for output, if '%OS' is not followed by a digit and getOption("digits.secs") is unset, the output has no fractional part, as if n = 0 is used.
>
That's because n = 0 _is_ used, and appears to have always been the
default (since the logic was added in r37395).  So this appears to be
a typo in the documentation (the comment about "n=3" when digits.secs
is unset was added in r37439).

>> getOption("digits.secs")
> NULL
>> z <- strptime("20/2/06 11:16:16.683", "%d/%m/%y %H:%M:%OS")
>> format(z, "%OS")
> [1] "16"
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2016 | www.rinfinance.com



[Rd] %OS on output
Joshua Ulrich