HI,

One possible way would be to use paste()
chron(times.=paste0("15:00",":00"),format=c(times="h:m:s"))
#[1] 15:00:00


#or you could use

library(lubridate)
hm("15:00")
#[1] "15H 0M 0S"
A.K.



----- Original Message -----
From: Stephen Sefick <sas0...@auburn.edu>
To: "r-help@r-project.org" <r-help@r-project.org>
Cc: 
Sent: Wednesday, May 1, 2013 12:28 PM
Subject: [R] Chron format question h:m not working

R 2.12.2 on Scientific Linux 6.4

#works
chron(times.="15:00:00", format=c(times="h:m:s"))

#doesn't work
chron(times.="15:00", format=c(times="h:m"))

>From chron Manual:
The times format can be any permutation of "h", "m", and "s" separated by any 
one non-special character. The default is "h:m:s".

what am I missing?

many thanks,


-- Stephen Sefick
**************************************************
Auburn University
Biological Sciences
331 Funchess Hall
Auburn, Alabama
36849
**************************************************
sas0...@auburn.edu
http://www.auburn.edu/~sas0025
**************************************************

Let's not spend our time and resources thinking about things that are so little 
or so large that all they really do for us is puff us up and make us feel like 
gods.  We are mammals, and have not exhausted the annoying little problems of 
being mammals.

                                -K. Mullis

"A big computer, a complex algorithm and a long time does not equal science."

                              -Robert Gentleman

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to