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.