R在mac上的word文档中保存结果

时间:2021-02-08 20:56:37

How do I save outcome in the console (e.g. a table) as a word document on a Mac? I tried the R2wd package, but that only works for windows. Is there an alternative?

如何在控制台(例如表格)中将结果保存为Mac上的word文档?我尝试了R2wd包,但这只适用于Windows。还有其他选择吗?

1 个解决方案

#1


1  

You can use R2HTML to save as an HTML document. Word can open these, so you can then resave in DOC format if you want.

您可以使用R2HTML保存为HTML文档。 Word可以打开这些,因此您可以根据需要以DOC格式重新保存。


For tables, you can save to CSV, open in Excel, then copy and paste into Word, which automatically creates a table.

对于表格,您可以保存为CSV,在Excel中打开,然后复制并粘贴到Word中,这会自动创建一个表格。

Slightly fancier is to use xlsx to save as an XLS spreadsheet, then do Insert -> Object... -> Microsoft Excel Worksheet. This can drastically increase the file size though.

稍微好一点是使用xlsx保存为XLS电子表格,然后执行插入 - >对象... - > Microsoft Excel工作表。这可以大大增加文件大小。

#1


1  

You can use R2HTML to save as an HTML document. Word can open these, so you can then resave in DOC format if you want.

您可以使用R2HTML保存为HTML文档。 Word可以打开这些,因此您可以根据需要以DOC格式重新保存。


For tables, you can save to CSV, open in Excel, then copy and paste into Word, which automatically creates a table.

对于表格,您可以保存为CSV,在Excel中打开,然后复制并粘贴到Word中,这会自动创建一个表格。

Slightly fancier is to use xlsx to save as an XLS spreadsheet, then do Insert -> Object... -> Microsoft Excel Worksheet. This can drastically increase the file size though.

稍微好一点是使用xlsx保存为XLS电子表格,然后执行插入 - >对象... - > Microsoft Excel工作表。这可以大大增加文件大小。