#' Fancy Scientific Notation
#'
#' Code taken from \url{http://stackoverflow.com/questions/11610377/how-do-i-change-the-formatting-of-numbers-on-an-axis-with-ggplot}
#'
#' @param l Input label
#' @return The number value in scientific notation
#' @export
fancy_scientific <- function(l) {
# turn in to character string in scientific notation
l <- format(l, scientific = TRUE)
# quote the part before the exponent to keep all the digits
l <- gsub("^(.*)e", "'\\1'e", l)
# turn the 'e+' into plotmath format
l <- gsub("e", "%*%10^", l)
# return this as an expression
parse(text=l)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.