How to create R documentation file (.Rd) in latex?

醉酒当歌 提交于 2019-12-05 01:42:27

There is the Rd2latex function in the tools package that will convert from the .Rd format to LaTeX format. This will let you preview the documentation in LaTeX. However this does not allow converting edits to the LaTeX document back to the .Rd document.

Look at Sweave, maybe it helpful for you.

Sweave is a tool that allows to embed the R code for complete data analyses in latex documents.

The purpose is to create dynamic reports, which can be updated automatically if data or analysis change. Instead of inserting a prefabricated graph or table into the report, the master document contains the R code necessary to obtain it. When run through R, all data analysis output (tables, graphs, etc.) is created on the fly and inserted into a final latex document.

The report can be automatically updated if data or analysis change, which allows for truly reproducible research.

Check out printr http://yihui.name/printr/ . It should do what you need if you are using knitr.

The problem with Rd2latex is that i haven't figured out which style file I need to use, otherwise it works fine.

When you generate the latex code with the Rd2latex function, make sure that you copy the Rd.sty file from the R directory, paste it and somewhere that latex can see it and use \usepackage{Rd}.

Try the knitr package, an easy way to generate flexible and fast dynamic reports with R for LaTex.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!