Problems with R CMD Rdconv and R CMD Sd2Rd (PR#8661)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problems with R CMD Rdconv and R CMD Sd2Rd (PR#8661)

Tim Hesterberg
I'm using R 2.2.0 on Windows.
Doing some conversions of help files.  Internal comments indicate
that the Sd2Rd conversion is "Converted by Sd2Rd version 1.21."

I'm converting
        .d -> .Rd
        .sgml -> .Rd
using Sd2Rd, then checking by using Rdconv to
convert .Rd back to .d or .sgml.

Here are errors in some of the conversions.
The most significant errors are in .Rd to .sgml.
The largest number of errors are in .Rd to .d (however,
this conversion is not so important).

        .Rd to .sgml
        R CMD Rdconv -t Ssgm file.Rd > file.sgml

If the .Rd contains
the section is missing completely from the sgml file.
(I reported this separately; it works fine when converting to .d)

Similarly, \keyword{lars}
is missing completely from the sgml file
(It works fine when converting to .d)

Rd converts \$ to \$; it should be just $.  This in .Rd


is converted to


It should be


or better yet


In \examples{},
should be converted verbatim rather than converted to

In the References section (and for links more generally?), file
names are missing the .sgm


is converted to:

<s-function name="lm">lm</s-function>
<s-function name="lsfit">lsfit</s-function>

It should be

<s-function name="lm.sgm">lm</s-function>
<s-function name="lsfit.sgm">lsfit</s-function>

        .sgml to .Rd
        R CMD Sd2Rd file.sgml > file.Rd


<tag> lar </tag>
least-angle regression
<tag> lasso </tag>
lasso method
<tag> stepwise </tag>
forward stepwise regression

is put verbatim into the .Rd
It should be converted into a \describe list

A references section should be converted to \references, not
\section{References}.  This

<s-section name = "REFERENCES">
Efron, ...

is converted to

Efron, ...

it should be

Efron, ...

        .Rd to .d
        R CMD Rdconv -t Sd file.Rd > file.d

It converts
It should be

It converts (in argument list)

.AG \&...

should be
.AG ...

\section{Side Effects}{
A plot is produced

.SH Side Effects
A plot is produced

should be
A plot is produced

\emph{Annals of Statistics}
\bold{32}, 407--451.

_Annals of Statistics_
*32*, 407-451.

Should be:
Annals of Statistics
\fB32\fP, 407-451.

Sd2Rd converts
        .PP in a .d file within the arguments section
        two blank lines in .Rd;
Rdconv converts that to
        .IP ""
would be better.

Rdconv loses comments.

the same order of computational cost as a least squares fit.

is converted to (missing a newline):

the same order of computational cost as a least squares fit..SH REFERENCES


is converted to
.FN lars.object

should be:
.FN lars.object
.FN class.lars

The document "Writing R Extensions" manual, chapter on
"Writing R documentation files" is silent about how to document S3 classes.
(It does mention S4 classes)

        .d to .Rd
        R CMD Sd2Rd file.d > file.Rd

A very common error when writing a .d file is to use .AG where you
should use .RC, in the .RT section, e.g.

Invisibly returns a list with components:
.AG fraction
See above
.AG cv
The CV curve at each value of fraction

Right now the converter is moving those into the "Arguments" section,
rather than leaving them in the "Value" section.  It would be nice
if they were left in the Value section.

--please do not edit the information below--

 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status =
 major = 2
 minor = 2.0
 year = 2005
 month = 10
 day = 06
 svn rev = 35749
 language = R

Windows XP Professional (build 2600) Service Pack 2.0

LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

Search Path:
 .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base

[hidden email] mailing list