Message-ID: <89b6b8c90809110223r5148bfc8nd5cd5b401295fbe8@mail.gmail.com>
Date: 2008-09-11T09:23:56Z
From: Yihui Xie
Subject: How to obtain a sequence of dates consisting of only weekdays
In-Reply-To: <AC9CF1A3B3582B4A847998B84DE457E4B7118D9E02@UKLONEXCPDV40.HDS.Int>
Then you can use c() to add the indices of those weeks which are not
"complete", or use something like this
# from Tuesday to next Wedsday
> !(2:10 %% 7) %in% c(0,6)
[1] TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE
Yihui
On Thu, Sep 11, 2008 at 5:08 PM, Weiyang Lim <Weiyang.Lim at henderson.com> wrote:
> Hi,
>
> Thanks for the reply. I also thought of your method. But it will not be quite right if my starting day is not on a Monday. Then, it will include weekends? Hope to have flexibility in that the starting day can be any day of the week not just monday.
>
> wy
>
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China