Dates? was Re: [R] Dates on Graphics

Peter Malewski p.malewski at tu-bs.de
Wed Jun 7 22:37:02 CEST 2000


Something like (!this is a quick make + it is very late "afternoon"):


> xd<-c("19-May-00", "22-May-00", "23-May-00", "24-May-00", "25-May-00")
> xx <- unlist(strsplit(xd,"-"))
> dim(xx) <- c(3,length(xx)/3)
> xx <- t(xx)
> xx[xx[,3]=="00",3] <- "2000"
> xd <- apply(xx,1,paste,collapse="-")
> xd
[1] "19-May-2000" "22-May-2000" "23-May-2000" "24-May-2000" "25-May-2000"

Peter
 


On Wed, 7 Jun 2000, Yves Gauvreau wrote:

> Hi,
> 
> I tried a few things with the date package and this is one of the result I
> get.
> 
> xd<-c("19-May-00", "22-May-00", "23-May-00", "24-May-00", "25-May-00")
> > as.date(xd)
> [1] NA NA NA NA NA
> 
> xd<-c("19-May-2000", "22-May-2000", "23-May-2000", "24-May-2000",
> "25-May-2000")
> > as.date(xd)
> [1] 19May2000 22May2000 23May2000 24May2000 25May2000
> 
> Any suggestion on how to word around this little problem? Note that this is
> a small sample, I would not like to have to do these corrections to hundreds
> of dates manualy.
> 
> Thanks in advance
> 
> YG
> 
> 
> ----- Original Message -----
> From: "Thomas Lumley" <thomas at biostat.washington.edu>
> To: "Yves Gauvreau" <cyg at sympatico.ca>
> Cc: "r-help" <r-help at stat.math.ethz.ch>
> Sent: Wednesday, June 07, 2000 12:41 PM
> Subject: Re: [R] Dates on Graphics
> 
> 
> > On Wed, 7 Jun 2000, Yves Gauvreau wrote:
> >
> > > Thanks for your prompt reply.
> > >
> > > I just want to point something out. I already had the date package
> loaded
> > > and when I tried help(plot.date) I got "Error in help(plot.date) : No
> > > documentation for `plot.date'". There is no mention of it either in the
> > > index of the package (date) in fact it's not mentioned anywhere except
> in
> > > the source. I don't think this can be called a bug but it would be nice
> to
> > > be able to find minimal documentation on this function.
> >
> > I could say that you might expect to get formatted dates when using plot()
> > on a date object, but in fact you are completely correct and I need to
> > update the documentation on the date package.
> >
> >
> > > This situation bring me to think that it would be nice to have a way to
> find
> > > information even when you don't know if it exist, some kind of
> searchable
> > > index. At this time I do this kind of search using the html search
> > > facilities. Is there some other way that one could this?
> >
> > Some of this can be done with apropos(), but I don't think you can keyword
> > search from inside R. It would be nice.
> >
> >
> > Thomas Lumley
> > Assistant Professor, Biostatistics
> > University of Washington, Seattle
> >
> >
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-
> > r-help 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-help-request at stat.math.ethz.ch
> >
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> _._
> >
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help 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-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

**************************************************************************
P.Malewski				Tel.: 0531 500965
Maschplatz 8				mailto: Peter.Malewski at gmx.de
************************38114 Braunschweig********************************

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list