Skip to content
Prev 38610 / 63424 Next

possible bug in chron packages

On Wed, 2010-12-08 at 11:26 +0100, Joris Meys wrote:
It does actually. If you read the code and/or debug `dates` to see what
is happening, `out.format` is passed on to `chron` which does its thing
and passes back the correctly formatted object as specified by
`out.format`.

However, `dates` then goes on to unclass the returned object and then
stick back on a class. It also tries to preserve the "format" in the
first line of `dates`

fmt <- attr(x, "format")

but in your example this is NULL as `x` is just a character. The code
reapplies this stored format later on with

attr(out, "format") <- fmt

as the last line before returning out.

The "format" attribute of the object returned by `chron` never gets
stored or used on the object returned form `dates`.

G