# Format printing numbers with comma separating thousands
f <- function(x, ...) {
format(x = x, big.mark=",", ...)
}
# Round
r <- function(x, ...) {
round(x = x, digits = 3, ...)
}
# Keep trailing zero's
# Significant figures: # http://stackoverflow.com/questions/3245862/
s <- function(vec, digits = 3, format = "f", flag = ""){
return(gsub("\\.$", "",
formatC(vec,
digits = digits,
# use "fg" for significant digits
format = format,
flag = flag)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.