[R-SIG-Finance] Simple Date Formatting

Dirk Eddelbuettel edd at debian.org
Sun Jan 3 20:36:03 CET 2010


Ralph,

On 3 January 2010 at 14:01, R. Vince wrote:
| Suppose I have a matrix, X, whose leftmost column is a date in the format:
| 
| 2009-07-10
| 
| how do I alter it such that it is formatted as:
| 
| 20090710
| 
| without using string manipulations? Surely there mist be a common means for 
| doing this? Also, how can I remove the rightmost column of a matrix prior to 
| doing a write.table() ? Thanks so much -RVince

See 
    help(Date)
    help(strptime)
    help(DateTimeClasses)

In a nutshell, parse it as a Date, then tell the Date to format as you want
it.  

But you will get told the same as everybody else here: Non-Finance questions
belong to r-help. Thanks for adhering to the spirit of the list.

Regards,  Dirk

-- 
Three out of two people have difficulties with fractions.



More information about the R-SIG-Finance mailing list