Vincent Goulet
2020-Jul-08 15:28 UTC
[Rd] Adding RtangleRuncode and RtangleFinish to exports of utils
Hi, Could R-Core consider adding 'RtangleRuncode' and 'RtangleFinish' to the exports of utils. Their weave equivalent 'makeRweaveLatexCodeRunner' and ?'RweaveLatexFinish' are exported, as well as the other tangle utility functions 'RtangleSetup' and 'RtangleWritedoc'. The rationale is not just symmetry. ;-) I'm finishing a small package that will provide "enhanced" drivers for Sweave that are heavily based on the standard RweaveLatex and Rtangle drivers. So much so that I can reuse most of the utiity functions called by RweaveLatex() and Rtangle(). Now, 'RtangleRuncode' and 'RtangleFinish' are not exported and 'R CMD check' really does not like that I use the ::: operator to reach the functions. The alternative is to duplicate the code verbatim in my package. This does not seem very sensible, especially since I would then need to track any changes to the aforementioned functions to remain in line. Here is the proposed patch against the current r-devel tree: Index: src/library/utils/NAMESPACE ==================================================================--- src/library/utils/NAMESPACE (revision 78794) +++ src/library/utils/NAMESPACE (working copy) @@ -166,9 +166,9 @@ Sweave, SweaveSyntConv, SweaveSyntaxLatex, SweaveSyntaxNoweb, RtangleWritedoc, RweaveChunkPrefix, RweaveEvalWithOpt, RweaveTryStop, SweaveHooks, RweaveLatexWritedoc, - RweaveLatexOptions, RweaveLatexFinish, + RweaveLatexOptions, RweaveLatexFinish, RtangleFinish, .RtangleCodeLabel, - makeRweaveLatexCodeRunner) + makeRweaveLatexCodeRunner, RtangleRuncode) if(tools:::.OStype() == "unix") { export(nsl) Best, v.
Weigand, Stephen D.
2020-Jul-08 18:44 UTC
[Rd] [EXTERNAL] Adding RtangleRuncode and RtangleFinish to exports of utils
Hi, For what it's worth, I would like to second this. I have a small Sweave driver (https://r-forge.r-project.org/R/?group_id=1857) that uses: RtangleRtf <- function(){ list(setup = RtangleSetup, runcode = utils:::RtangleRuncode, # <--- writedoc = RtangleWritedoc, finish = utils:::RtangleFinish, # <--- checkopts = RweaveRtfOptions) } And of course using ':::' generates warnings. Elsewhere I use utils:::SweaveParseOptions(opts, object$options, RweaveRtfOptions) and so if it is sensible to also export 'SweaveParseOptions' then that would be great. With appreciation, Stephen -----Original Message----- From: R-devel [mailto:r-devel-bounces at r-project.org] On Behalf Of Vincent Goulet via R-devel Sent: Wednesday, July 08, 2020 10:28 AM To: R-devel at r-project.org Subject: [EXTERNAL] [Rd] Adding RtangleRuncode and RtangleFinish to exports of utils Hi, Could R-Core consider adding 'RtangleRuncode' and 'RtangleFinish' to the exports of utils. Their weave equivalent 'makeRweaveLatexCodeRunner' and ?'RweaveLatexFinish' are exported, as well as the other tangle utility functions 'RtangleSetup' and 'RtangleWritedoc'. The rationale is not just symmetry. ;-) I'm finishing a small package that will provide "enhanced" drivers for Sweave that are heavily based on the standard RweaveLatex and Rtangle drivers. So much so that I can reuse most of the utiity functions called by RweaveLatex() and Rtangle(). Now, 'RtangleRuncode' and 'RtangleFinish' are not exported and 'R CMD check' really does not like that I use the ::: operator to reach the functions. The alternative is to duplicate the code verbatim in my package. This does not seem very sensible, especially since I would then need to track any changes to the aforementioned functions to remain in line. Here is the proposed patch against the current r-devel tree: Index: src/library/utils/NAMESPACE ==================================================================--- src/library/utils/NAMESPACE (revision 78794) +++ src/library/utils/NAMESPACE (working copy) @@ -166,9 +166,9 @@ Sweave, SweaveSyntConv, SweaveSyntaxLatex, SweaveSyntaxNoweb, RtangleWritedoc, RweaveChunkPrefix, RweaveEvalWithOpt, RweaveTryStop, SweaveHooks, RweaveLatexWritedoc, - RweaveLatexOptions, RweaveLatexFinish, + RweaveLatexOptions, RweaveLatexFinish, RtangleFinish, .RtangleCodeLabel, - makeRweaveLatexCodeRunner) + makeRweaveLatexCodeRunner, RtangleRuncode) if(tools:::.OStype() == "unix") { export(nsl) Best, v. ______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel