[Rd] Sexpr in package.Rd fails

Martin Morgan mtmorgan at fhcrc.org
Tue Sep 7 07:40:47 CEST 2010


If I

f = function() {}
package.skeleton("PkgA", "f", path="/tmp")

and then edit man/PkgA-pacakge.Rd to read in part

\description{
More about what it does (maybe more than one line)
\Sexpr{1}
}

and then

R CMD build PkgA

I end up with

Saving output to ‘/tmp/PkgA/build/PkgA.pdf’ ...
Warning in file.create(to[okay]) :
cannot create file '/tmp/PkgA/build/PkgA.pdf', reason 'No such file or
directory'
Done

This is because the 'build' directory does not exist when the pdf is
being written.

Further, if I

\details{
\tabular{ll}{
Package: \tab PkgA \cr
Type: \tab Package\cr
Version: \tab \Sexpr{packageDescription("PkgA")[["Version"]]} \cr
Date: \tab 2010-09-06\cr
License: \tab What license is it under?\cr
LazyLoad: \tab yes\cr
}
}

I see

* installing the package to process help pages
* building the package manual
Hmm ... looks like a package
Converting Rd files to LaTeX Warning in packageDescription("PkgA") : no
package 'PkgA' was found
Error : /tmp/PkgA/man/PkgA-package.Rd:16: subscript out of bounds

The package appears to be installed for processing help pages without
Sexprs, but not with.

This is from a post on the Bioconductor 'devel' list.

https://stat.ethz.ch/pipermail/bioc-devel/2010-September/002296.html

with

> sessionInfo()
R version 2.12.0 Under development (unstable) (2010-09-05 r52874)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

Martin



More information about the R-devel mailing list