[R] to convert a character string in time

2010-02-03 Thread karine heerah
hi, I have my data time expressed in character string exple 5:20 (hour:min) and i want to convert these in times recognized by R. I have tried the POSIXct function: balise07$Hour - as.POSXIct(balise07$Hour) but it didn't work. Do you know why? Do you know how i can convert my

Re: [R] to convert a character string in time

2010-02-03 Thread jim holtman
Try this: as.POSIXct(5:30, format=%H:%M) [1] 2010-02-03 05:30:00 EST On Wed, Feb 3, 2010 at 8:27 AM, karine heerah karine.hee...@hotmail.fr wrote: hi, I have my data time expressed in character string exple 5:20 (hour:min) and i want to convert these in times recognized by R. I have

Re: [R] to convert a character string in time

2010-02-03 Thread Gabor Grothendieck
Try this (and see R News 4/1): library(chron) tt - times(paste(5:20, 00, sep = :)); tt [1] 05:20:00 tt + 12/24 # add 12 hours [1] 17:20:00 On Wed, Feb 3, 2010 at 8:27 AM, karine heerah karine.hee...@hotmail.fr wrote: hi, I have my data time expressed in character string exple 5:20