is there a more efficient/elegant method of doing the following in which I concatenate all the numbers in the output of the Sys.time() output
x <- as.character(Sys.time())
paste0(substr(x,0,4),substr(x,6,7),substr(x,9,10),substr(x,12,13),substr(x,15,16),substr(x,18,20))
It probably includes paste and collapse somehow but not sure how to do it...
I would have thought format to be the first choice:
format(Sys.time(), "%Y%m%d%H%M%S")
[1] "20120909231732"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With