Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

discrete_breaks

Discrete Breaks


Description

Creates a function that can be passed to scales for creating discrete breaks at multilples of resolution.

Usage

discrete_breaks(resolution = 1)

Arguments

resolution

Resolution of the breaks

Value

A function that can be passed to scales functions as the breaks argument.

Examples

x <- rbinom(100, 100, 0.4)
p <- gf_bar( ~ x)
p %>% gf_refine(scale_x_continuous(breaks = discrete_breaks()))
p %>% gf_refine(scale_x_continuous(breaks = discrete_breaks(5)))
p %>% gf_refine(scale_x_continuous(breaks = discrete_breaks(2)))

ggformula

Formula Interface to the Grammar of Graphics

v0.10.1
MIT + file LICENSE
Authors
Daniel Kaplan [aut], Randall Pruim [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.