Thank you very much, Prof Ripley. The problem is solved and my understanding is improved.
Happy holidays! - Alex ________________________________ From: Prof Brian Ripley <rip...@stats.ox.ac.uk> To: Alex Zhang <alex.zh...@ymail.com> Cc: "r-help@R-project.org" <r-help@r-project.org> Sent: Wednesday, December 14, 2011 11:39 AM Subject: Re: [R] A Question Re ISOdatetime On 14/12/2011 16:24, Alex Zhang wrote: > Dear all, > > I am using the ISOdatetime function like this: > > test.info$TradeTime = with(test.info, mapply(FUN = ISOdatetime, Year, Month, > Day, Hour, Minute, 60, "EST")) > > > Where Year, Month etc are all numeric. > > I think ISOdatetime should return a POSIXct object. However, the result I > obtained from the line above is all numeric. Could you please advise? I wish > to get POSIXct. ISOdatetime did: mapply threw away the class. See its SIMPLIFY argument, which defaults to TRUE. It this case it is unnecessary: e.g. ISOdatetime(2011, c(11,12), c(30,1), 1, 30, 35, tz="EST") A 'sec' value of 60 should not be used ... it indicates a leap second which POSIX ignores. > Thank you very much. > > - Alex -- Brian D. Ripley, rip...@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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.