[R] split number in a vector and then make a chron object out of it

2009-08-13 Thread stephen sefick
These are date and times in the format MMDDhhmmss. I would like to take this column and make a chron object form them. I have tried a couple of the split family of functions but they need character input here is the data: date.time - c(19851001001500, 19851001003000, 19851001004500,

Re: [R] split number in a vector and then make a chron object out of it

2009-08-13 Thread Henrique Dallazuanna
Try this: strptime(date.time, %Y%m%d%H%M%s) On Thu, Aug 13, 2009 at 1:59 PM, stephen sefick ssef...@gmail.com wrote: These are date and times in the format MMDDhhmmss. I would like to take this column and make a chron object form them. I have tried a couple of the split family of

Re: [R] split number in a vector and then make a chron object out of it

2009-08-13 Thread John Kane
I'm not sure that I understand your problem but if you want the vector in character rather than numeric try: library(Hmisc) library(Hmisc) time.date- Cs(19851001001500, 19851001003000, 19851001004500, 1985100101, 19851001011500, 19851001013000, 19851001014500, 1985100102,

Re: [R] split number in a vector and then make a chron object out of it

2009-08-13 Thread Gabor Grothendieck
Try this: as.chron(date.time, %Y%m%d%H%M%S) On Thu, Aug 13, 2009 at 12:59 PM, stephen sefickssef...@gmail.com wrote: These are date and times in the format MMDDhhmmss.  I would like to take this column and make a chron object form them.  I have tried a couple of the split family of