Re: [R] Inserting a character into a character string XXXX

2012-01-26 Thread Dan Abner
3" >   [7] "04:04" "00:37" "13:20" "00:04" "02:11" "23:20" > You could also check that tmp%/%100 (the hour) and tmp%%100 > (the minute) are in their expected ranges before calling > sprintf. > > Bill Dunlap > Spotfire

Re: [R] Inserting a character into a character string XXXX

2012-01-26 Thread William Dunlap
check that tmp%/%100 (the hour) and tmp%%100 (the minute) are in their expected ranges before calling sprintf. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: Dan Abner [mailto:dan.abne...@gmail.com] > Sent: Thursday, January 26, 2012

Re: [R] Inserting a character into a character string XXXX

2012-01-26 Thread Dan Abner
o nothing > to "5".  Pad with 0's before calling sub if that is > required. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On >> Beh

Re: [R] Inserting a character into a character string XXXX

2012-01-26 Thread William Dunlap
ore calling sub if that is required. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Dan Abner > Sent: Thursday, January 26, 2012 6:50 AM > To: r-help@r-pr

Re: [R] Inserting a character into a character string XXXX

2012-01-26 Thread Gerrit Eichner
Hello, Dan, you could probably use a combination of nchar(), substr() (or substring()) and paste(). Take a look at their online help pages. Hth -- Gerrit Hello everyone, I have a character vector of 24 hour time values in the format hm without the delimiting ":". How can I insert the ":"

[R] Inserting a character into a character string XXXX

2012-01-26 Thread Dan Abner
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