On 5/9/08, Ola Caster <[EMAIL PROTECTED]> wrote: > > Sorry for spamming the list... > > > I noticed that if you first produce a date histogram with the hist() > function, like this: > > basic.histogram <- hist(my.data$date, breaks = "months", plot = FALSE) > > and then try to transfer the breaks from that histogram to a lattice > equivalent, like this: > > histogram(~date, data=my.data, breaks=basic.histogram$breaks) > > then I get a histogram that looks exactly like the original one, except the > bins are not placed correctly on the x-axis. In my case they were all > shifted almost a year to the right. Does anyone know why this happened and > if there is a way to deal with it?
I can't comment on what you see unless you give us a reproducible example, but I only see a shift in the label positions (so the labels are different, but still accurate in both cases). For example, foo <- Sys.Date() + 10 * rnorm(100) bar <- hist(foo, breaks = "months") dev.new() histogram(~foo, breaks = bar$breaks, scales = list(x = list(format = "%b %d"))) -Deepayan ______________________________________________ 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.