For a model I am working on, I have samples organized by year and week of
the year.  For this model, the data (year and week) comes from the basic
sample data, but I require a value representing the amount of time since the
sample was taken (actually, for the purpose of the model, it is sufficient
to use the number of weeks from the middle of the sample week to the
present).

What I have found so far includes:

library(Rmetrics)
time1 = timeDate(charvec = Sys.Date(), format = "%Y-%m-%d", zone = "",
FinCenter = "")
time2 = timeDate("2004-08-30", format = "%Y-%m-%d", zone = "", FinCenter =
"")
difftimeDate(time1,time2,units = "weeks")


Does timeDate use the format strings used by the UNIX date(1) command?  If
so, then can I safely assume timeDate will accept "%Y-%U-%w", and behave
correctly?

Thanks,

Ted

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to