I'm less concerned with figuring out how to handle them in R than figuring out how to get them into R via rpy2. DateVector would be a nice way to handle this; how would you recommend doing it?
What I thought I might try is sending it in ISO format using datetime's isoformat() operator, encapsulating that as a StrVector. This doesn't work though: sdpf = ro.DataFrame( {'rawdate': ro.StrVector([d.isoformat() for d in rawdates]), JDO ----- Original Message ---- From: Laurent <lgaut...@gmail.com> To: John Owens <john_ow...@yahoo.com> Cc: "RPy help, support and design discussion list" <rpy-list@lists.sourceforge.net> Sent: Sat, April 24, 2010 3:26:58 PM Subject: Re: [Rpy] python dates -> rpy dates -> ggplot2 dates, how to? Date vectors in R can be handled in several ways. Check the documentation and the R lists. Having a DateVector is an interesting idea. It could possibly make working with dates vectors easier from rpy2 than from R. On 23/04/10 21:18, John Owens wrote: > Howdy, I'd like to bring Python dates into rpy2 (and then into > ggplot2). How might this best be done? R evidently supports dates > natively. > > What seems ideal is having a DateVector in the vein of FloatVector, > StrVector, and so on. > > If I put a date in the format "datetime.date" into a Vector, python > returns > > ValueError: Nothing can be done for the type<type 'datetime.date'> > at the moment. > > It would be easy for me to convert datetime.date into any other format, > though. > > Any suggestions appreciated. Thanks! > > JDO > > > ------------------------------------------------------------------------------ > _______________________________________________ > rpy-list mailing list > rpy-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rpy-list ------------------------------------------------------------------------------ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list