R CMD build
无论 Rd 文件是否包含,其行为都会有所不同\PR{}
。有关宏的详细信息,请参阅编写 R 扩展。
Rd 文件不包含的示例\PR{}
:
$ R CMD build test
* checking for file 'test/DESCRIPTION' ... OK
* preparing 'test':
* checking DESCRIPTION meta-information ... OK
* installing the package to process help pages
* saving partial Rd database
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building 'test_0.1.tar.gz'
Rd 文件包含的示例\PR{}
:
$ R CMD build test
* checking for file 'test/DESCRIPTION' ... OK
* preparing 'test':
* checking DESCRIPTION meta-information ... OK
* installing the package to process help pages
* saving partial Rd database
* building the PDF package manual # <- this
Hmm ... looks like a package # <- this
Converting Rd files to LaTeX # <- this
Creating pdf output from LaTeX ... # <- this
Saving output to 'xxx/test.pdf' ... # <- this
Done # <- this
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building 'test_0.1.tar.gz'
额外的阶段(即building the PDF package manual
,在旧计算机上可能会很慢......)是由于在 .build_packages 中调用了..Rd2pdf (第 619-625 行)。但是我不明白是什么触发了这个阶段。此外,它仅对\PR{}
其他宏(例如\CRANpkg{}
和)触发,而不会触发\doi{}
。
有人可以追溯发生了什么,为什么?问题仅针对基本 R 函数。我不使用诸如devtools
.
最小测试包
封装结构
test
test/man
test/man/one.Rd
test/R
test/R/one.R
test/DESCRIPTION
test/NAMESPACE
test/man/one.Rd
\name{one}
\alias{one}
\title{Get One}
\description{
Rd file containing or not the PR macro:
\PR{1} % comment/uncomment this line as needed
but containing other macros:
\CRANpkg{ggplot2} and \doi{10.1002/wics.147}
}
\usage{
one()
}
test/R/one.R
one <- function() 1
test/DESCRIPTION
Package: test
Version: 0.1
Title: Test
Author: Nobody
Maintainer: Nobody <no@body.org>
Description: Test.
License: GPL-3
test/NAMESPACE
export(one)
构建、检查和安装:
$ R CMD build test
$ R CMD check test_0.1.tar.gz
$ R CMD INSTALL test_0.1.tar.gz