int_breaks: Make axis labels that are numeric but should only integer...

View source: R/int_breaks.R

int_breaksR Documentation

Make axis labels that are numeric but should only integer values

Description

Make axis labels that are numeric but should only integer values

Usage

int_breaks(n = 5, ...)

Arguments

n

integer giving the desired number of intervals. Non-integer values are rounded down. (passed to base::pretty)

...

further arguments passed to base::pretty

Value

a vector or axis labels of length n

Examples

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))

Close-your-eyes/fcexpr documentation built on Sept. 29, 2023, 12:27 a.m.