Skip to content
R for the Rest of Us Logo

Making Beautiful Tables with R

Export Your Tables

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

What will happen here is pretty straightforward.

save_as_docx(
  final_table,
  path = 'final_table.docx'
)

# Make sure that you have {webshot2} and phantomJS installed. The latter can be installed via {webshot2}
save_as_image(
  final_table,
  path = 'final_table.png',
  webshot = 'webshot2'
)
[1] "/media/albert/Files/NextCloud/R Projects/tables-course/final_table.png"
# Beware that in the output pptx file there can be empty cells that have huge font. 
# This will cause the line heights of the cells to be large. 
# You have to manually tweak this.
save_as_pptx(
  final_table,
  path = 'table.pptx'
)

Your Turn

Export your last table as a .docx-, .png- and .pptx-file. For the .png-file use the webshot2 package (which you need to have installed). You will also need to install phantomJS, which you can download here. Beware that in the output .pptx-file there can be empty cells that have a huge font. This will cause the line heights of the cells to be large. You have to manually tweak this.

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.