#' Number of ticks for \code{ggplot2} plots
#'
#' Function for determining number of ticks on axis of \code{ggplot2} plots.
#' @param n Integer giving the desired number of ticks on axis of
#' \code{ggplot2} plots. Non-integer values are rounded down.
#' @section Details:
#' Based on function \code{pretty} (\code{dampack} package).
#' @export
number_ticks <- function(n) {
function(limits) {
pretty(limits, n + 1)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.