Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Christina Karamperidou
great, I used the global option, and set the cut.off to 10, so now it understands all years from 1913 to 2005 without a problem and, as per your instructions in other threads, I got all the daily, monthly, yearly averages in the proper way. thank you so much! Christina K. ck4...@gmail.com P Ple

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Gabor Grothendieck
Here is one more solution. chron has a global option, chron.year.expand, that can be set to a function that will do the 2 year to 4 year translation. We can use it to change the cut.off to 20 (instead of 30). (Its important to set the option after the library(chron) call since that call resets t

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Christina Karamperidou
thanks a million for solving this problem for me! I really appreciate it. best, Christina K. ck4...@gmail.com P Please consider the environment - Do you really need to print this email? On Mar 30, 2010, at 5:44 PM, Gabor Grothendieck wrote: > The problem is that chron uses 30 as the cutoff yea

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Gabor Grothendieck
The problem is that chron uses 30 as the cutoff year for two digit years. If the year is prior to 30 it adds 2000 to the two digit year to get the 4 digit year and if the 2 digit year is 30 or more it adds 1900 to the two digit year to get the 4 digit year. In the line marked # we convert

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Christina Karamperidou
true, sorry, I posted a few minutes ago the code for going from 1929 to 1930, and it is not working on my computer. so, when I use the full record, z goes from 1930 to 2005, and then jumps to what it perceives to be 2013 and takes it all the way to 2029 (when in reality it is 1913 to 1929) Line

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Gabor Grothendieck
What is the problem? The code in your post seems to work fine: > Lines <- "Date Time Value + 12/31/99 22:00:00 1.8 + 12/31/99 23:00:00 1.9 + 01/01/00 00:00:00 1.8 + 01/01/00 01:00:00 1.7 + 01/01/00 02:00:00 1.6 + 01/01/00 03:00:00 1.5 + 01/01/00 04:00:00 1.4 + 01/01/00 05:00:00

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Christina Karamperidou
I was wrong before not to check the turn of 1929 to 1930. So, here is what happens: Lines <- "Date Time Value 149014 12/31/29 21:00:00 1.4 149015 12/31/29 22:00:00 1.4 149016 12/31/29 23:00:00 1.5 149017 01/01/30 00:00:00 1.6 149018 01/01/30 01:00:00 1.7 149019 01/01/30 02:00:00

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Christina Karamperidou
Truly sorry about before. So, it works perfectly fine when I do it at the turn of the century, but still when I try it on my full record, I get the same problem. Maybe it is reading in the table in a wrong way. I just read it in as DF <- read.table("myfile.dat", header = TRUE, as.is = TRUE) m

Re: [R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Gabor Grothendieck
Not for me. Please provide your data and code in reproducible form as per last line of every r-help message and the posting guide. > Lines <- "Date Time Value + 01/01/13 00:00:00 1.6 + 01/01/13 01:00:00 1.6 + 01/01/13 02:00:00 1.6 + 01/01/13 03:00:00 1.6 + 01/01/13 04:00:00 1.6 + 01

[R] question on creating zoo object from indexed time series: re-arranges dates

2010-03-30 Thread Christina Karamperidou
Dear all, I have a time series of daily measurements that starts like this: KWhourly[1:10,] Date Time Value 01/01/13 00:00:00 1.6 01/01/13 01:00:00 1.6 01/01/13 02:00:00 1.6 01/01/13 03:00:00 1.6 01/01/13 04:00:00 1.6 01/01/13 05:00:00 1.6 01/01/13 06:00:00 1.6 01/01/13 0