Calculates a vector of breaks that contains all integers between 0 and max(x) (with a little bit of extra headroom in case the maximum element is an integer)
Arguments
- x
The input vector for which the breaks should be calculated. Note that there is no fancy NSE here, the actual variable must be passed to the function, and also that the function currently does not handle negative data and will error out if passed such data.
See also
Other functions extending ggplot
:
gg_apply_labs()
,
gg_apply()
Examples
if ( require(ggplot2) ) {
ggplot(mtcars) +
aes(wt,drat) +
geom_point() +
scale_y_continuous(breaks=gg_integer_breaks(mtcars$drat))
}