I'm working with the htmlTable
function. While the table renders perfectly in the R studio viewer, I am unable to save, copy and paste, or screenshot it, such that it looks equally nice in the word document I am writing. I was wondering if there was a way for me to export or save the image, such that the table show up just as nice in the word document.
Here is an example table.
output <-
matrix(paste("Example", LETTERS[1:16]),
ncol=4, byrow = TRUE)
library(htmlTable)
htmlTable(output)
You can display your table as grid graphics using grid.table
function from gridExtra
library. And save it as image using ggsave
function from ggplot
library.
library(ggplot2)
library(gridExtra)
ggsave(grid.table(output), filename = "~DirectoryName/imageName.png")