From ggrothendieck at gmail.com  Thu May 20 13:01:35 2010
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Thu, 20 May 2010 07:01:35 -0400
Subject: [Rd] pretty.Date(): new "halfmonth" time step
In-Reply-To: <AANLkTim1YYlrryyI5-24VgYNVBTU-fxNe8cZlowrL86e@mail.gmail.com>
References: <AANLkTim1YYlrryyI5-24VgYNVBTU-fxNe8cZlowrL86e@mail.gmail.com>
Message-ID: <AANLkTilwStAV-c2AXj8gH0Jz8zH3-071AkJOcCUj8yZJ@mail.gmail.com>

Note that in the zoo package that as.Date.yearmon has a frac= argument, e.g.

> library(zoo)
> ym <- as.yearmon("2010-01")
> as.Date(ym, frac = 0.5)
[1] "2010-01-16"


On Wed, May 19, 2010 at 9:56 PM, Daniel Murphy <chiefmurphy at gmail.com> wrote:
>>Much better to implement directly what this is trying to do: i.e. to
>>have a "halfmonth" time step. This is just the union of two "monthly"
>>sequences, one on the 1st of each month and another on the 15th of
>>each month.
>
> For some applications that might be true. But not for others. For a month
> with 31 days, there are 14 days before the 15th of the month and 16 days
> after the 15th, so, for example, March 16th (specifically noon) rather than
> March 15th would be the halfway point if you define "halfway" in terms of
> the distances to the beginning and end of the month. For a month with 30
> days -- like April -- the halfway point would be the instant between the
> 15th and the 16th of the month. Do you label that instant April 15 or April
> 16? ?(I prefer "15".) Don't get me started on February.
>
> - Dan Murphy
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] pretty.Date(): new "halfmonth" time step
Gabor Grothendieck