Copy/paste table into gmail

I would suggest using the Markdown Here extension, available for Chrome and Firefox (the last time I checked). Used in conjunction with kable from "knitr" (already recommended) you can get a nicely formatted table in seconds.

After installation, you will be able to find a "markdown toggle" option in your right-click context menu when composing an email.

Here's a GIF to show the steps.

enter image description here

Do this often? Save yourself the copying step at least by creating a helper function to write to the clipboard (this is Windows only, but you can expand on the function if you wanted compatibility with other OSes).

gmailTable <- function(indf) writeClipboard(capture.output(knitr::kable(indf)))

Then, in R, just do gmailTable(mtcars), switch over to Gmail, paste the contents of the clipboard into the message area, and markdown toggle as before :-)

By the way, "Markdown Here" also lets you use a shortcut to convert whatever is in the message area to HTML. By default, I believe it is ctrl + shift + m.

Tags:

Gmail

R

Rstudio