R community, I am trying to create an array of the time differences between datapoints for a very large set. For some reason for 4 of the values the difference has been calculated as NA. Looking at the individual points two of them are "1981-03-29 01:40:00" and "1981-03-29 02:00:00" This is the exact same format as the other points that return values of 20 mins as expected. In such a large dataset (600,000+ entries) I don't know why only 4 would be doing this. Apologies for such a vague question but can anyone shed any light on what may be wrong? Thanks, Doug -- View this message in context: r.789695.n4.nabble.com/difftime-error-tp3010105p3010105.html Sent from the R help mailing list archive at Nabble.com.
On 25.10.2010 12:55, dpender wrote:> > R community, > > I am trying to create an array of the time differences between datapoints > for a very large set. For some reason for 4 of the values the difference > has been calculated as NA. > > Looking at the individual points two of them are "1981-03-29 01:40:00" and > "1981-03-29 02:00:00"Note that "1981-03-29 02:00:00" is exactly the time of a daylight saving time change and needs declaration of a time zone. You may want to force tz="GMT" if you think the time difference was really 20 minutes (rather than 1:20 or -0:40 or whatever that is). Best, Uwe Ligges> > This is the exact same format as the other points that return values of 20 > mins as expected. > > In such a large dataset (600,000+ entries) I don't know why only 4 would be > doing this. > > Apologies for such a vague question but can anyone shed any light on what > may be wrong? > > Thanks, > > Doug
On Mon, 25 Oct 2010, dpender wrote:> > R community, > > I am trying to create an array of the time differences between datapoints > for a very large set. For some reason for 4 of the values the difference > has been calculated as NA. > > Looking at the individual points two of them are "1981-03-29 01:40:00" and > "1981-03-29 02:00:00"Do such times exist in your unstated timezone? The first definitely does not in the UK timezone (hint DST started at 1am on that day). What precisely happens when you specify invalid date-times is system-dependent, and you have not stated yours (pace the posting guide). But I am surprised you got NA.> This is the exact same format as the other points that return values of 20 > mins as expected. > > In such a large dataset (600,000+ entries) I don't know why only 4 would be > doing this. > > Apologies for such a vague question but can anyone shed any light on what > may be wrong? > > Thanks, > > Doug > -- > View this message in context: r.789695.n4.nabble.com/difftime-error-tp3010105p3010105.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, stats.ox.ac.uk/~ripley University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595