write_table <- function(df, path) {
extension <- tools::file_ext(path)
fnc <- c(csv = data.table::fwrite, tsv = data.table::fwrite, xlsx = openxlsx::write.xlsx)[[extension]]
fnc(df, path)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.