int_breaks | R Documentation |
Make axis labels that are numeric but should only integer values
int_breaks(n = 5, ...)
n |
integer giving the desired number of intervals. Non-integer values are rounded down. (passed to base::pretty) |
... |
further arguments passed to base::pretty |
a vector or axis labels of length n
int_breaks(n=3)(c(1,4,5,6,7,10))
int_breaks(n=6)(c(1.1,4.9,5.8,6,7,10.78))
# or pass to ggplot2: ggplot2::scale_x_continuous(breaks = int_breaks(n = 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.