#' Give a number as percentage
#'
#' Converts a number or vector of numbers to percent values and appends the percentage sign.
#'
#'
#' @param x A number or vector of numbers
#' @param y An optional integer defining the number of digits, default = 1
#' @return Converts the number x to percentage with suffix '%'
#'
#' @author TKG RM Team
#' @note Version 0, Creation 21.10.2019
#'
#' @examples
#' percent(0.1023, 3)
#' percent(c(.88232, .32314, .01953, 23.454), 2)
#' @export
percent <- function(x, digits = 1, format = "f", ...) {
paste0(formatC(100 * x, format = format, digits = digits, ...), "%")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.