[R-SIG-Finance] Problem with the timeDate function
Strong
strongthinking at gmail.com
Mon Sep 24 18:06:35 CEST 2007
From: Moshe Olshansky <m_olshansky at yahoo.com>
Subject: Re: [R-SIG-Finance] Problem with the timeDate function
Date: Sun, 23 Sep 2007 17:14:04 -0700 (PDT)
Thanks for your reply.
But, what should I do to add a day to my original 1990.01 date string within R.
And, is there a way to convert the period in my date string to hyphen?
Strong Chen
> Hello,
>
> I am also new to Rmetrics so take what I say with
> caution.
> The string "1990.01" is not a valid date - you must
> add a day also (even if you do not care about the day
> add a dummy one, let say 1, so that you date is
> "1990.01.01"). This is a valid date but then you have
> another problem (as indicated by your error message) -
> if you specify date only then the format is assumed to
> be "%Y-%m-%d" and so a period (.) can not be a
> separator. So you can either specify the date as
> "1990-01-01" or supply a valid time as well, i.e.
> timeDate("1990.02.01.00.00.01",format="%Y.%m.%d.%H.%M.%S").
>
> Regards,
>
> Moshe.
>
> --- Strong <strongthinking at gmail.com> wrote:
>
> >
> > Dear All
> >
> > I am a beginner of Rmetrics. It is the first time I
> > posts on the mailing list.
> >
> > I am having a problem with the use of timeDate
> > function.
> >
> > I tried to use timeDate function in the fCalendar
> > package to convert a character string of date to
> > into the timeDate object.
> >
> > My script is something like the followings:
> >
> > < date <- c("1990.01", "1990.02")
> >
> > < date.td <- timeDate(date, format="%Y.%m")
> >
> > And then, I got the following error message:
> >
> > Error in if (sum(lt$sec + lt$min + lt$hour) == 0)
> > isoFormat = "%Y-%m-%d" :
> > missing value where TRUE/FALSE needed
> > In addition: Warning message:
> > Unknown Format Specification in:
> > .whichFormat(charvec)
> >
> > I don't know what's wrong with my format
> > specification. It seems the reason is I am not
> > using the standard iso format, although I do
> > believe the flexible specification of time format is
> > allowed by the timeDate function just like in
> > S-Plus.
> >
> > Can anyone help me?
> >
> > Thanks in advance.
> >
> >
> > Strong Chen
> > phd Student, Graduate School of Commerce and
> > Management;
> > Hitotusbashi University, Tokyo, Japan
> >
> > _______________________________________________
> > R-SIG-Finance at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only.
> > -- If you want to post, subscribe first.
> >
>
>
More information about the R-SIG-Finance
mailing list