Weijia
Weijia

Reputation: 79

R remove character from date value

I have a data.frame, with a typical date column goes like this: 29-Jan-14,...

However, some of the date values begin with a character T, they look like this: T29-Jan-14,...

How do I delete that T?

Upvotes: 0

Views: 893

Answers (1)

A5C1D2H2I1M1N2O1R2T1
A5C1D2H2I1M1N2O1R2T1

Reputation: 193517

Just use sub on the vector of "dates".

> sub("^T", "", "T29-Jan-14")
[1] "29-Jan-14"

Upvotes: 1

Related Questions