hadley/ggplot2 — pull request #591 by wch (2012-06-25 05:14:48+00:00)
Title: Extended breaks

This is to be used with hadley/scales#22, where the default breaks algorithm is changed to `extended_breaks()`. Since `extended_breaks()` doesn't work with dates and times, the default for dates/times needs to be set to the original `pretty_breaks()`.

This still has a problem: if you don't specify `scale_x_date()`, it instead uses the plain old `scale_x_continuous()`, which uses `extended_breaks()`:

```R
set.seed(321)
df <- data.frame(
dx = seq(as.Date("2012-02-29"), len=100, by="1 day")[sample(100, 50)],
price = runif(50)
)
df <- df[order(df$dx), ]

# This works now:
qplot(dx, price, data=df, geom="line") + scale_x_date()

# This doesn't:
qplot(dx, price, data=df, geom="line")
# Error in Math.difftime(35.9333333333333, base = 10) :
# 'log' not defined for "difftime" objects
```

I think the problem is that `scales_add_defaults()` in scales-.r only appends `discrete` and `continuous` to the scale name, when in this case it should append `date`.