s-news
[Top] [All Lists]

Re: timeRelative

To: "Tony Plate" <tplate@blackmesacapital.com>
Subject: Re: timeRelative
From: "David Huffer" <David.Huffer@csosa.gov>
Date: Thu, 21 Sep 2006 11:37:05 -0400
Cc: <s-news@lists.biostat.wustl.edu>
Thread-index: AcbdjVRt96Q0+IC2Rx6L4B4JhgnFpgABZ97A
Thread-topic: [S] timeRelative
On Thursday, September 21, 2006 10:50 AM, Tony Plate wrote:

 > ...The example given in the docs of
 > S-PLUS 7.0 works OK for me in S-PLUS
 > 7.0.  I suspect your problem is spaces
 > after the '-' and "+".  (My docs don't
 > have spaces, but your examples do.)...

Yes, that is indeed the problem:

  >  rt <- timeRelative("-a0mth - 1fri + 3fri")
  >  timeDate(c("1/5/1998", "2/26/1998"),format = "%a %m/%d/%Y") + rt
  [1] NA NA
  >

versus

  >  rt <- timeRelative("-a0mth -1fri +3fri")
  >  timeDate(c("1/5/1998", "2/26/1998"),format = "%a %m/%d/%Y") + rt
  [1] Fri 1/16/1998 Fri 2/20/1998
  > 

--
Thanks,
David

<Prev in Thread] Current Thread [Next in Thread>