Re: [R] Changing X axis of ggplot

2012-01-03 Thread Joshua Wiley
Hi Aren, Thanks for sending the data. I poked around a bit, and here was what I came up with (a bit of a hack really, but perhaps acceptable enough). lbl_formatter looks like another way to go. require(ggplot2) require(chron) ## hack to deal with non exported method parse.format <- chron:::par

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Aren Cambre
Got it figured out. I found this post on the ggplot2 Google Group: http://groups.google.com/group/ggplot2/browse_thread/thread/698e658b6dfec56c/5390824dab4a1cd7 It recommends you make this function: lbl_formatter <- function(x) { h <- floor(x/60) m <- floor(x %% 60) s <- round(60*(x %%

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Aren Cambre
I'm not sure I know yet what I'm looking for. :-) I have a list of all traffic tickets written in Dallas, TX over a few years. One of the first things I am doing is reviewing the data to make sure the quality is good; I'm trying to see whether it just looks right. One measure is whether the volum

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Aren Cambre
It's below. And I meant offense_time, not offense_hour. > dput(dallas[1:40, "offense_time", drop = FALSE]) structure(list(offense_time = structure(c(0.3895833, 0.336, 0.4270833, 0.4097222, 0.4375, 0.6486111, 0.4715278, 0.561, 0.01

Re: [R] Changing X axis of ggplot

2012-01-02 Thread Joshua Wiley
Hi Aren, Could you perhaps send us the output of: dput(dallas[1:40, "offense_hour", drop = FALSE]) I believe your problem, but getting it to work in ggplot2 will be easiest working with your actual data (or a bit of it anyway). for ggplot2 specific questions, you might also checkout: groups.goo

Re: [R] Changing X axis of ggplot

2012-01-02 Thread Hasan Diwan
Aren, On 2 January 2012 19:34, Aren Cambre wrote: > I am making a plot using this: > p <- ggplot(dallas, aes(x = offense_hour)) + geom_bar() + coord_polar() > The plot shows up fine, but the X axis labels are 0.0 through 1.0. How > do I convert this to 0:00 through 23:59 (or whatever may be > appr

[R] Changing X axis of ggplot

2012-01-02 Thread Aren Cambre
Thanks to Joshua Wiley for turning me on to ggplot2. I am making a plot using this: p <- ggplot(dallas, aes(x = offense_hour)) + geom_bar() + coord_polar() Dallas is a data frame, and offense_hour is a column with chron objects from the chron library. In this case, the chron object was created wi