#' @title Comma formatter
#'
#' @description Per poder escollir entre el "." i la "," com a separador decimal. Útil en plots en versió en espanyol.
#'
#' @param x a numeric vector to format
#' @param dec.mark The internal code respects the option getOption("OutDec") for the ‘decimal mark’, so if this is set to something other than "." then it takes precedence over argument decimal.mark.
#' @param ... other arguments passed on to format.
#' @return a function with single parameter x, a numeric vector, that returns a character vector.
#' @export
comma2 <- function(x, dec.mark = NULL, ...) {
if(is.null(dec.mark)) dec.mark = getOption("OutDec")
format(x, decimal.mark = dec.mark, trim = TRUE, scientific = FALSE, ...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.