| To: | s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | Y2K problem |
| From: | Agin.Patrick@hydro.qc.ca |
| Date: | Thu, 15 Nov 2001 14:45:10 -0500 |
|
Hi, Under Windows NT on Splus 4.5, I try to read a text file which contains in column 1 dates and in column 2 numbers. Here are the first few lines of the file: 12-Dec-85 10.05
First, I read the data in vec: > vec <- scan(file = "D:\\timeseries.txt", what = list("character", numeric())) After, I construct an univariate time series with arbitrary sampling time intervals in ts0: > ts0 _ its(vec[[2]],times=dates(vec[[1]], format = "day-mon-yr"))
As you see, the error message seems to indicate that dates in my file are not in ascending order. I found after many tries that the problem concerns year 2000 dates. The command
> ts0 _ its(vec[[2]][1:2334],times=dates(vec[[1]][1:2334], format = "day-mon-yr")) returns no error message and
> ts0 _ its(vec[[2]][1:2335],times=dates(vec[[1]][1:2335], format = "day-mon-yr")) returns the same error message as above. Here is the vector of dates around 2335: > vec[[1]][2333:2336]
The 2335th element is the first occurence in my file of year 2000. Now, if you sort the vector, the result is: > sort(dates(vec[[1]][2333:2336],format="day-mon-yr"))
S-Plus seems to consider 01/04/0 as 01/04/1900 (which obviously is less than 12/30/1999). Is there a setting that you can set to tell S-Plus to consider 99 as 1999 and 00 as 2000? Thank you very much,
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | range of argument for trigonometric functions, Naoki Saito |
|---|---|
| Next by Date: | problem with RECODE function in S-PLUS 2000, Gilliam, Reid |
| Previous by Thread: | range of argument for trigonometric functions, Naoki Saito |
| Next by Thread: | problem with RECODE function in S-PLUS 2000, Gilliam, Reid |
| Indexes: | [Date] [Thread] [Top] [All Lists] |