On Thu, 11 Jan 2001 stephen@anc.ed.ac.uk wrote:> Hi, > > The help file for strptime has the following code which doesn't work > for me: > > ## read in date info in format `ddmmmyyyy' > x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960") > z <- strptime(x, "%d%b%Y") > > z > [1] "NA" "NA" "NA" "NA" > > Do these work for other people?Yes, on several platforms. It will be a problem with your OS's strptime code. It must be, I think, as the alternative we supply works.> whereas it works fine if I use a separator (/) in the date@ > > > strptime("9/Feb/1960", "%d/%b/%Y") > [1] "1960-02-09" > > > strptime("9Feb1960", "%d%b%Y") > [1] "NA"We really do not put out new features without testing them!> > Stephen > > p.s. I failed to send this using bug.report(); on DEC OSF/1, "mailx" > does not recognise the -c switch for setting the carbon copy (CC) > field, causing an error. One solution might be to remove the -c > argument from the cmdarg in bug.rerport(), or put a > "~c joe@bloggs.com" directive at the end of the file to set the CC field. > > --please do not edit the information below-- > > Version: > platform = alphaev56-dec-osf4.0f > arch = alphaev56 > os = osf4.0f > system = alphaev56, osf4.0f > status > major = 1 > minor = 2.0 > year = 2000 > month = 12 > day = 15 > language = R > > Search Path: > .GlobalEnv, package:ctest, Autoloads, package:base > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ligges@statistik.uni-dortmund.de
2001-Jan-12 10:15 UTC
[Rd] problem with strptime example (PR#811)
ripley@stats.ox.ac.uk wrote:> > On Thu, 11 Jan 2001 stephen@anc.ed.ac.uk wrote: > > > Hi, > > > > The help file for strptime has the following code which doesn't work > > for me: > > > > ## read in date info in format `ddmmmyyyy' > > x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960") > > z <- strptime(x, "%d%b%Y") > > > z > > [1] "NA" "NA" "NA" "NA" > > > > Do these work for other people? > > Yes, on several platforms. It will be a problem with your OS's strptime > code. It must be, I think, as the alternative we supply works. > > > whereas it works fine if I use a separator (/) in the date@ > > > > > strptime("9/Feb/1960", "%d/%b/%Y") > > [1] "1960-02-09" > > > > > strptime("9Feb1960", "%d%b%Y") > > [1] "NA" > > We really do not put out new features without testing them!Also very strange on WinNT4.0 (R-1.2.0): x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960") z <- strptime(x, "%d%b%Y") z [1] "1960-01-01 01:00:00" "1960-01-02 01:00:00" "NA" "1960-07-30 01:00:00" Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 12 Jan 2001, Uwe Ligges wrote:> > ripley@stats.ox.ac.uk wrote: > > > > On Thu, 11 Jan 2001 stephen@anc.ed.ac.uk wrote: > > > > > Hi, > > > > > > The help file for strptime has the following code which doesn't work > > > for me: > > > > > > ## read in date info in format `ddmmmyyyy' > > > x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960") > > > z <- strptime(x, "%d%b%Y") > > > > z > > > [1] "NA" "NA" "NA" "NA" > > > > > > Do these work for other people? > > > > Yes, on several platforms. It will be a problem with your OS's strptime > > code. It must be, I think, as the alternative we supply works. > > > > > whereas it works fine if I use a separator (/) in the date@ > > > > > > > strptime("9/Feb/1960", "%d/%b/%Y") > > > [1] "1960-02-09" > > > > > > > strptime("9Feb1960", "%d%b%Y") > > > [1] "NA" > > > > We really do not put out new features without testing them! > > > Also very strange on WinNT4.0 (R-1.2.0): > > > x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960") > z <- strptime(x, "%d%b%Y") > z > [1] "1960-01-01 01:00:00" "1960-01-02 01:00:00" "NA" > "1960-07-30 01:00:00"I don't get the NA. The 1am is a Windows bug: this only happens in times prior to 1970, which for Windows do not exist. It seems to assume that if isdst is non-zero, it is DST, rather than for isdst > 0. I have a workaround, so for 1.2.1 (on my machines) this will behave as expected. The date-time functions do depend on OS functions being correct, and although I have done a lot of workarounds, no doubt more errors will emerge. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._