[R] Histogram over times (without dates)

From: Dubravko Dolic <Dubravko.Dolic_at_komdat.com>
Date: Fri 25 Mar 2005 - 03:38:50 EST

Dear Group,    

Having a character vector like this one:  

[1] "03:38:55" "07:42:38" "08:04:27" "08:17:13" "08:41:14" "08:46:58"

[7] "08:47:11" "08:53:51" "08:57:51" "08:58:56"  

I try to do a histogram over times of a day. All I want to know, if my solution is proper or if there is another way to go.  

There is no Information about the day on which this time occurred. it is unimportant as I want to know at what times on a day a costumer buys anything (times are collected from logfiles).

The values span 24 hours (e.g. 00:00:00 to 23:59:59)  

I converted the characters to chron objects (library(chron)) and then to numeric vectors:  

ordertm.num <- as.numeric(chron(times = ecom$Ordertime))    

Then I put the numeric values to hist(), printed the hist without axes=F and constructed my own axis.  

The result is satisfactory. But as there are so many possibilities with times on R (namely using the POSIX classes) I want to be shure if there is no "standard" approach to handle such time related problems (note that the date is irrelevant to my problem).  

have a goof Easter holiday  

All the best  

Dubravko Dolic              

Dubravko Dolic <http://www.dolic.de/pagedd.html>

Tel: +49 (0)89-55 27 44 - 4630

Fax: +49 (0)89-55 27 44 - 2463

Email: dubravko.dolic@komdat.com

Komdat GmbH

Nymphenburger Straße 86 / TH 3

80636 München

Partners for your success

www.komdat.com <outbind://96-000000009676DC1A07BA5142BC1A44984B6E7FAC070052D1AC81378E9342947189B04176014700000017F023000052D1AC81378E9342947189B04176014700000017F7DA0000/www.komdat.com>


        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Mar 25 03:47:55 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:55 EST