[R] code/documentation mismatches
Torsten Hothorn
Torsten.Hothorn at rzmail.uni-erlangen.de
Thu Sep 6 09:57:19 CEST 2001
> Hi,
>
> I would like to get a hint on how to debug in the case of
>
> #> R CMD check pllib
>
> signalling
>
> * checking for code/documentation mismatches ... WARNING
> Error in parse(file, n, text, prompt) : syntax error on line 22
>
> I am able to sort out which of the files is the culprit is by swapping
> files in and out of the /R and /man directories. But I cannot find the
> syntax error, the .Rd file seems to be correct.
This is done in ./src/scripts/check
$log->checking("for code/documentation mismatches");
my $Rcmd = "$TMPDIR/Rcmd.$$";
my $Rout = "$TMPDIR/Rout.$$";
open Rcmd, "> $Rcmd" || die "Cannot write to \`$Rcmd'\n";
print Rcmd "codoc(dir = \"${pkgdir}\")\n";
close Rcmd;
system("${R_exe} ${R_opts} --quiet < ${Rcmd} > ${Rout}");
my @out;
open Rout, "< $Rout";
while(<Rout>) {chomp; push(@out, $_);}
close Rout;
unlink($Rcmd);
unlink($Rout);
we can see that the code checked is generated by "codoc", therefore:
R> codoc(dir="path_to_mypackage")
returns the code to be checked. Often the error above is caused by a
newline in the parameter-list in the Rd-file.
Torsten
>
> It would be helpful to have an indication of the file which contains the
> error. The corresponding line in
>
> \pllib.Rcheck\pllib-Ex.R
>
> is even a blank line.
>
> Thanks for help
> --christian
> Dr.sc.math.Christian W. Hoffmann
> Mathematics and Statistical Computing
> Landscape Modeling and Web Applications
> Swiss Federal Research Institute WSL
> Zuercherstrasse 111
> CH-8903 Birmensdorf, Switzerland
> phone: ++41-1-739 22 77 fax: ++41-1-739 22 15
> e-mail: christian.hoffmann_at_wsl.ch__prevent_spamming
> www: http://www.wsl.ch/staff/christian.hoffmann/
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list