#' Round* a number to the nearest given value.
#' (* can use floor or ceiling).
#'
#' \code{roundto(x, z = 1, drop=NULL)}
#'
#' @param x a vector of numeric values
#' @param z the number to which rounding will be done
#' @param FUN the function for rounding, either round, floor or ceiling
#'
#' @details Simple convenience function for rounding* a number to
#' the nearest given value. (* can use floor or ceiling).
#'
#' @examples
#' roundto(1:10, 5, round)
#'
#' roundto(1:10, 5, floor)
roundto = function(x, z = 1, FUN = round){
FUN(x/z)*z
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.