简体   繁体   中英

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 ?

Just use sub on the vector of "dates".

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM