[R] Inserting a character into a character string XXXX

Dan Abner dan.abner99 at gmail.com
Thu Jan 26 15:49:49 CET 2012


Hello everyone,

I have a character vector of 24 hour time values in the format hm
without the delimiting ":". How can I insert the ":" immediately to
the left of the second digit from the right?

mytimes<-scan(what="")
 1457
 1457
 1310
 1158
 137
 1855


Thanks!

Dan



More information about the R-help mailing list