A note about xts:

The time class layer is abstracted from the implementation. This allows for some very time specific manipulation without having to manage the underlying details.

Take a look at the xts docs and vignette.

Also, the functions .indexmon .indexyear etc correspond to the POSIXlt components. The xts object doesn't use this as a class, but this allows you access as if it did.

HTH
Jeff

Jeffrey A. Ryan
jeffrey.r...@insightalgo.com

ia: insight algorithmics
www.insightalgo.com

On Jan 22, 2010, at 12:18 PM, "Brian G. Peterson" <br...@braverock.com> wrote:

FMH wrote:
Dear All,

I have a series of data in which the first column consist of a combination of date and time, for instance 17 April 2008 at 4.01pm, such data is recorded as:

4/17/2008 16:01
I'd like to seperate it into four different columns which consist of Day, Month,Year and Time, respectively.

Could someone please advice me on this mater?

Use xts.

Specify a POSIXlt index

All of the properties will be available in POSIXlt.

However, you didn't state what you wish to accomplish. It is likely that xts will be able to subset anything you need without splitting things up.

Realize that using a real time series class will always perform better than using a data frame.

Cross-posting is considered rude. If you need more help than the above, please make your query specific to some problem in finance, to keep the list focused on its topic (finance), or only reply to r- help.

It would be polite to sign your name too...

Regards,

  - Brian

--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock

_______________________________________________
r-sig-fina...@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.

______________________________________________
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.

Reply via email to