Alternative ways to export tbl_summary as png in R

Viewed 1172

I am trying to export my tbl_summary from R as a png file. I've tried

gt::gtsave(as_gt(demtable),file="demographic_table.png")

It comes up with the error

PhantomJS not found. You can install it with webshot::install_phantomjs()

However I am unable to execute this command (probably as I am working with data within a safe haven and R cannot connect to the internet)

Therefore I am wondering if there is any other ways to export this type of table

2 Answers

Below a possible solution.

You could try the dfSummary function from library(summarytools)

dfSummary(data_1)

The output file written is:

C:\Users\EarlMascetti\AppData\Local\Temp\RtmpIJ7JC4\file970319bdcd.html

The summary is: enter image description here

I ended up opening it in a new window and when right clicking could save it in excel

Related