简体   繁体   English

如何导出或制作图表在R中应用功能族

[英]How to export or make a chart Apply Family of functions in R

require("quantmod")
getSymbols("AAPL")
apply.yearly(AAPL[,1], mean)

          AAPL.Open
2007-12-31  128.3891
2008-12-31  142.3138
2009-12-31  146.6191
2010-12-31  259.9576
2011-12-30  364.0614
2012-12-31  576.6527
2013-12-31  473.1281
2014-12-31  295.1426
2015-09-30  122.1547

I'd like to be able to present these results to someone: How do I export the results? 我希望能够将这些结果呈现给某人:如何导出结果? I can do it with something like knitR and Rmarkdown into a report, but I'd like to be able to do a fast export. 我可以使用诸如knitR和Rmarkdown之类的功能将其导入报告中,但是我希望能够进行快速导出。

A lot depends on what exactly you mean by "fast export". 在很大程度上取决于您“快速导出”的确切含义。 If you want something that you can paste into an email quickly and have it look nice, your best bet is probably Hmisc::html , which will save to a file and pop it up in a web browser, where you can copy the table somewhere else. 如果您想要一些可以快速粘贴到电子邮件中并且看起来不错的东西,那么最好的选择是Hmisc::html ,它将保存到文件中并在网络浏览器中弹出,您可以在其中将表格复制到某个地方其他。

If you're looking for a data export (so that someone can put it into Excel or similar) then you can just use write.csv to write out a csv with the results, and send that file. 如果您正在寻找数据导出(以便有人可以将其放入Excel或类似文件中),则可以使用write.csv来写出带有结果的csv,然后发送该文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM