0

When trying to export a table created using formattable() in R using the png(), jpeg(), pdf(), etc. commands I only get a blank file with the correct title, but no content or file type.

I've created basic graphs and tried to export them multiple times with the various export to png/jpeg/pdf commands and it works so I'm not sure why the table is any different.

# Open png file for exporting
png(file = "Family_Table_Output")

# Create table
formattable(my_data)

# Close png file
dev.off()

I expected there to be a png file in the working directory that when opened displays the chart. What happens in actuality is that the table appears in the table/graph viewer and a file with no type (just says file) is created in the working directory that when opened is blank.

A. Suliman
  • 12,923
  • 5
  • 24
  • 37
  • Hi here is the solution i guess. [https://stackoverflow.com/questions/38833219/command-for-exporting-saving-table-made-with-formattable-package-in-r] The Problem is that you print the plot environment in which is nothing. `formattable` uses the Viewer to output – Johannes Stötzer Sep 04 '19 at 09:37
  • See also answer to https://stackoverflow.com/questions/45298144/convert-html-output-to-image – Otto Kässi Sep 04 '19 at 09:40
  • `huxtable::quick_pdf()` can print data frames, tables etc. to a pdf. Package author here. – dash2 Sep 05 '19 at 20:47

0 Answers0