hadley/scales — pull request #26 by wch (2012-07-18 18:42:00+00:00)
Title: Fix zero_range function.

This is a rewrite of `zero_range`. It fixes hadley/ggplot2#620.

Among other things, it makes the following changes:

* Check that there are exactly 1 or 2 elements.
* Handle `NA` and `Inf` values.
* Simplify handling when `x` values are equal - just return true of `x[1] == x[2]`.
* Instead of using smallest value as the scaling factor, use the smallest _magnitude_ value as the scaling factor.
* Use a specified threshold for `zero_range`.

See the examples and tests for more information.