本地R包的PDF文档 [英] PDF documentation of local R package

查看:233
本文介绍了本地R包的PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用roxygen2devtools创建了本地R包.看起来效果不错,但是我想知道我当时如何获得完整的PDF文档.由于description和.Rd文件是由roxygen2自动创建的,因此,我认为有一种简便的方法可以将它们转换为单个PDF文档.

I created a local R package using roxygen2 and devtools. It seem work well but I would like to know how I get the complete PDF documentation then. Since the DESCRIPTION and .Rd files are created by roxygen2 automatically, I'd think there's a easy way to translate them into a single PDF document.

推荐答案

我认为这里有一个命令供您使用:R CMD Rd2pdf.通过它的帮助:

I think there's a command here for you: R CMD Rd2pdf. From its help:

edd@max:~$ R CMD Rd2pdf --help
Usage: R CMD Rd2pdf [options] files

Generate PDF output from the Rd sources specified by files, by
either giving the paths to the files, or the path to a directory with
the sources of a package, or an installed package.

Unless specified via option '--output', the basename of the output file
equals the basename of argument 'files' if this specifies a package
or a single file, and 'Rd2' otherwise.

The Rd sources are assumed to be ASCII unless they contain \encoding
declarations (which take priority) or --encoding is supplied or if using
package sources, if the package DESCRIPTION file has an Encoding field.
The output encoding defaults to the package encoding then to 'UTF-8'.

Files are listed in the order given: for a package they are in alphabetic
order of the \name sections.

Options:
  -h, --help            print short help message and exit
  -v, --version         print version info and exit
      --batch           no interaction
      --no-clean        do not remove created temporary files
      --no-preview      do not preview generated PDF file
      --encoding=enc    use 'enc' as the default input encoding
      --outputEncoding=outenc
                        use 'outenc' as the default output encoding
      --os=NAME         use OS subdir 'NAME' (unix or windows)
      --OS=NAME         the same as '--os'
  -o, --output=FILE     write output to FILE
      --force           overwrite output file if it exists
      --title=NAME      use NAME as the title of the document
      --no-index        don't index output
      --no-description  don't typeset the description of a package
      --internals       typeset 'internal' documentation (usually skipped)

The output papersize is set by the environment variable R_PAPERSIZE.
The PDF previewer is set by the environment variable R_PDFVIEWER.

Report bugs at bugs.r-project.org .
edd@max:~$ 

这篇关于本地R包的PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆