如何在乳胶中创建R文档文件(.Rd)?
问题描述:
有没有一种简单的方法可以为简单的R函数创建R文档文件?
Is there a simple way to create R documentation file for simple R functions?
我知道我可以在R-studio中编辑.Rd
文件并在HTML文件中预览.但是如何将其放入乳胶中进行编辑和预览?是否有一些生成R文档格式的乳胶包?
I know I can edit a .Rd
file in R-studio and preview it in HTML file. But how to put it into latex to edit and preview? Is there some latex package producing R documentation format?
答
在工具包中有Rd2latex
函数,它将从.Rd格式转换为LaTeX格式.这将使您可以预览LaTeX中的文档.但是,这不允许将对LaTeX文档的编辑转换回.Rd文档.
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.