I''ve been converting a number of .sgml S-documentation filed to .Rd format and a few persistent complications--all involving the documentation''s examples--have arisen every time I issue the standard R CMD check to prepare my project for building. The impression I get is that the check script simply tries to execute every R command in the included documentation''s example{ } sections. But since Sd2Rd essentially dumps an S-documentation file''s example contents into the new .Rd file, formatting problems crop up. Correct me if I''m wrong, but Sd2Rd neither strips each example line''s opening greater-than (">") nor prunes the output. And then check barks at me when R can''t execute either of the ">"-padded example code or the actual output, which I didn''t even intend for it to try to interpret in the first place. In the meantime, I''ve been using a Perl script that sifts through a set of .Rd''s and makes the proper connections, stripping all ">"s and sticking "\dontrun"s around the output, but I was wondering if there''s a better or built-in way. Any advice? Kevin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 26 Jun 2001, Bartz, Kevin wrote:> I''ve been converting a number of .sgml S-documentation filed to .Rd format > and a few persistent complications--all involving the documentation''s > examples--have arisen every time I issue the standard R CMD check to prepare > my project for building. The impression I get is that the check script > simply tries to execute every R command in the included documentation''s > example{ } sections. But since Sd2Rd essentially dumps an S-documentation > file''s example contents into the new .Rd file, formatting problems crop up. > Correct me if I''m wrong, but Sd2Rd neither strips each example line''s > opening greater-than (">") nor prunes the output. And then check barks at meRight. There are no conventions for example sections in S''s .d or .sgml files.> when R can''t execute either of the ">"-padded example code or the actual > output, which I didn''t even intend for it to try to interpret in the first > place. In the meantime, I''ve been using a Perl script that sifts through a > set of .Rd''s and makes the proper connections, stripping all ">"s and > sticking "\dontrun"s around the output, but I was wondering if there''s a > better or built-in way. Any advice?If that works for you, that''s the best I know of. Most authors of S help files do not include the > nor the output, so I see few problems in the literally hundreds of such files I have ported. When I do, I have to hand edit, and for example the VR conversion scripts contain a set of patch files to convert my co-author''s conventions to R''s. But I am glad to know that someone is benefiting from the work I put in writing the .sgml->.Rd converter. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 26 Jun 2001, Bartz, Kevin wrote:> I''ve been converting a number of .sgml S-documentation filed to .Rd format > and a few persistent complications--all involving the documentation''s > examples--have arisen every time I issue the standard R CMD check to prepare > my project for building. The impression I get is that the check script > simply tries to execute every R command in the included documentation''s > example{ } sections. But since Sd2Rd essentially dumps an S-documentation > file''s example contents into the new .Rd file, formatting problems crop up.Indeed. And not just formatting problems. S has never enforced a policy on whether examples should be executable source or session transcripts (though the former seems much more common), or on whether executable source actually has to run, so the format doesn''t let you specify, and it would be hard for a program to guess. R does enforce a policy, as you have found. However, in converting other people''s S help files I have found editing the content of the examples to be more work than editing the format -- S examples don''t have to work, but R examples do. -thomas Thomas Lumley Asst. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._