to_csv_text <- function(xdf, ...) {
r <- rawConnection(raw(0), "r+")
on.exit(close(r), add=TRUE)
readr::write_csv(
x = xdf,
path = r,
...
) -> res
invisible(rawConnectionValue(r))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.