[R] Extract pattern from string

2011-11-15 Thread syrvn
Hello, with Sys.time() you get the following string: 2011-11-15 16:25:55 GMT How can I extract the following substrings: year - 2011 month - 11 day_time - 15_16_25_55 Cheers, Syrvn -- View this message in context:

Re: [R] Extract pattern from string

2011-11-15 Thread Justin Haynes
take a look at the structure of what Sys.time returns. str(Sys.time) and now at ?strptime! format(Sys.time(),format='%d-%H-%M-%S') [1] 15-09-55-55 format(Sys.time(),format='%Y') [1] 2011 format(Sys.time(),format='%m') [1] 11 Hope that helps, Justin On Tue, Nov 15, 2011 at 9:48 AM,

Re: [R] Extract pattern from string

2011-11-15 Thread syrvn
Wow, that is a very clever way to do it. Thank you very much! Cheers, Syrvn -- View this message in context: http://r.789695.n4.nabble.com/Extract-pattern-from-string-tp4073432p4074023.html Sent from the R help mailing list archive at Nabble.com.