基本R - 输出基本R相关表->乳胶或文本
我正在使用 http://myowelt 生成关联表。 blogspot.com/2008/04/beautiful-correlation-tables-in-r.html
然而,我没有成功地将文件输出到可用的 LaTex 文件或文本文件。 我使用 sink()
将数据保存到文本文件失败。
假设我使用以下命令:
corstarsl(lpp_axis1)
如何将输出传输到文本文件?我已阅读有关接收器的文档,但我在某处遗漏了一个步骤。 (我打开连接,执行命令,取消链接文件,然后什么也没找到。)
我还尝试在 tex 文件中使用 xtable(cortstarsl(lpp_axis1))
的输出,但我收到了“未找到元素表”错误。我对 Tex 的了解不够,无法跟踪问题的根源。
输出此数据的建议? 关于创建关联表的其他建议?
I am generating a correlation table with http://myowelt.blogspot.com/2008/04/beautiful-correlation-tables-in-r.html
I am not successful, however, in outputting the file to a usable LaTex file or text file.
I have been unsuccessful using sink()
to save the data to a text file.
Suppose I am using the following command:
corstarsl(lpp_axis1)
How would I pipe the output to a text file? I've read the documentation on sink and I'm missing a step somewhere. (I open the connection, execute the command, unlink the file and then I find nothing.)
I've also tried using the output from xtable(cortstarsl(lpp_axis1))
in a tex file yet I receive a "element table not found error. I do not know enough about Tex to track the source of the problem.
Suggestions for outputting this data?
Other suggestions for creating a correlation table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用您链接到的网页中的代码,我得到(使用内置的
airquality
数据):因此,接下来的问题是如何将此 TeX 输出获取到文件。这里的
capture.output()
是一个朋友:它将代码输出到名为
mytable.tex
的文件:对于“纯”分隔文本输出,也许转储到文字处理器中或电子表格,请尝试
write.table()
,例如:生成的文件如下所示:
您可以根据自己的喜好更改引用和分隔符 - 请参阅
?write.table
。Using the code from the web page you link to, I get (with the built in
airquality
data):So the question then is how to get this TeX output to a file. Here
capture.output()
is one friend:Which outputs the code to file named
mytable.tex
:For "plain" delimited text output, perhaps to dump into a word processor or Spreadsheet, try
write.table()
, eg:Which results in a file like this:
You can alter the quoting and delimiter to your heart's content - see
?write.table
.