load("data/conversion table.RData")
library(dplyr)
tabular <- function(df, ...) {
stopifnot(is.data.frame(df))
align <- function(x) if (is.numeric(x)) "r" else "l"
col_align <- vapply(df, align, character(1))
cols <- lapply(df, format, ...)
contents <- do.call("paste",
c(cols, list(sep = " \\tab ", collapse = "\\cr\n ")))
paste("\\tabular{", paste(col_align, collapse = ""), "}{\n ",
contents, "\n}\n", sep = "")
}
conversion_table %>%
select_("name", "catalog_symbol", "base_unit") %>%
arrange_("base_unit") %>%
tabular()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.