Hi,
I have a column of a dataframe which has time stamps
like:
eh$t[1]
[1] 06/05/2005 01:15:25
and was wondering how to convert it to chron variable.
Thanks a lot.
Young.
__
R-help@stat.math.ethz.ch mailing list
On 7/13/05, Young Cho [EMAIL PROTECTED] wrote:
Hi,
I have a column of a dataframe which has time stamps
like:
eh$t[1]
[1] 06/05/2005 01:15:25
and was wondering how to convert it to chron variable.
Thanks a lot.
Try this:
# test data frame eh containing a factor variable t
eh
[I had some emails problems so I am sending this again. Sorry
if you get it twice.]
On 7/13/05, Gabor Grothendieck [EMAIL PROTECTED] wrote:
On 7/13/05, Young Cho [EMAIL PROTECTED] wrote:
Hi,
I have a column of a dataframe which has time stamps
like:
eh$t[1]
[1] 06/05/2005
are those dates in m/d/y or d/m/y ?
?chron and watch out for
format = c(dates = d/m/y, times = h:m:s)
On 13/07/05, Gabor Grothendieck [EMAIL PROTECTED] wrote:
[I had some emails problems so I am sending this again. Sorry
if you get it twice.]
On 7/13/05, Gabor Grothendieck [EMAIL
An easy to check what you have is to use month.day.year:
eh - data.frame(t = c(06/05/2005 01:15:25, 06/07/2005 01:15:25))
# substring converts factor to character and extracts substring
chron(dates = substring(eh$t, 1, 10), times = substring(eh$t, 12))
[1] (06/05/05 01:15:25) (06/07/05