prettybreaks
contains functions to create pretty breaks for numeric vectors.
Its main function pretty2()
is similar to base::pretty()
but allows to use different number systems and other tweaks.
The package is very simple by purpose. Its main aim is to give a good starting point for building a new package, see file "packaging.R" for the full workflow.
library(devtools)
install_github("mayer79/prettybreaks")
library(prettybreaks)
x <- 1:100
pretty2(x) # c(0, 20, 40, 60, 80, 100)
pretty2(x, n = 4) # c(0, 50, 100, 150)
pretty2(x, base = 5) # c(0, 25, 50, 75, 100)
pretty2(x, p = c(10/7, 20/7, 50/7)) # c(0., 28.57143, 57.14286, ...)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.