[R] Best way to replace :SS with :00

John Kane jrkrideau at yahoo.ca
Thu Jul 16 21:59:55 CEST 2009


It your times are chron objects then 
 trunc(tt, "minutes") 
where tt are your times may do what you want.  It truncated but that seems to be what you want. 

--- On Thu, 7/16/09, Jason Rupert <jasonkrupert at yahoo.com> wrote:

> From: Jason Rupert <jasonkrupert at yahoo.com>
> Subject: [R] Best way to replace :SS with :00
> To: R-help at r-project.org
> Received: Thursday, July 16, 2009, 3:25 PM
> 
> Not sure if there is an R way to do this or a regular
> express way, but here is what I am trying to do.
> 
> I've got lots of data where the format is HH:MM:SS, but I
> need to format it like HH:MM:00, i.e. round the second down
> to zero.  
> 
> What is the best way to do this? 
> 
> Thanks again.
> 
> Jason
> 
> ______________________________________________
> R-help at 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.
> 


      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/




More information about the R-help mailing list