Re: [R-pkg-devel] Workaround for code/documentation mismatch

2021-08-11 Thread Duncan Murdoch

On 10/08/2021 11:25 p.m., Andrew Simmons wrote:

Hello,


I've written two functions to emulate do while/until loops seen in other
languages, but I'm having trouble documenting its usage. The function is
typically used like:

do ({
 expr1
 expr2
 ...
}) %while% (cond)

so I want to document it something like:

do(expr) %while% (cond)
do(expr) %until% (cond)

to look like the documentation for 'while' and 'if', but R CMD check
produces a "Code/documentation mismatch" warning, complaining that the
documentation should look like:

expr %while% cond
expr %until% cond

So, my question is, is there a way to bypass the
* checking for code/documentation mismatches
portion of R CMD check, at least for one file? Some way to acknowledge that
the code and documentation will mismatch, but that's okay.



I think the answer is no.  What I'd do is name the first argument to the 
operator in a way to indicate that it must be the result of do() and the 
second to indicate it must be parenthesized (if that's a 
requirement...), e.g.


`%while%` <- function(do_expr, parenthesized_cond) { ... }

and then document as

do_expr %while% parenthesized_cond

in the \usage section, and document standard usage in the \details 
section and examples.


Duncan Murdoch

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Workaround for code/documentation mismatch

2021-08-11 Thread Andrew Simmons
Hello,


@Martin Maechler:
%until% and %while% use R's builtin repeat function. Something like

do(expr) %until% (cond)
repeat {
expr
if (cond)
break
}

are identical. After %until% and %while% check the arguments look correct,
it makes a call to repeat like above and evaluates it in the same
environment as %until% or %while% was called from. I haven't completely
reinvented the wheel here.
%until% and %while% are slower than repeat, but only by a microsecond or
two.
Admittedly, my documentation for %until% and %while% is dog water compared
to repeat, but I've tried to make it as clear as possible in my
documentation that %until% and %while% use repeat,
and included the link to the documentation for repeat.


@Duncan Murdoch:
I'll try renaming the arguments, thank you for the suggestion. Also, I
didn't realize you could put R comments in \usage with #, so I might try
that as well, thank you!

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] advice on reminders/nags to CRAN maintainers

2021-08-11 Thread Ben Bolker



  Wondering about etiquette/if I should start over again with a package 
submission. tl;dr, the package has been 'waiting' since 30 July (I 
responded the same day to the queries that were sent).


  For what it's worth, the 'pretest-waiting-recheck' message below was 
sent from *a* CRAN maintainer, but hitting "reply-all" in my mail client 
only included the "cran-submissi...@-rproject.org" address. Maybe my 
mail client is misconfigured → supposed to respond to the sender as well 
as the Reply-To: address? I could poke the individual CM who sent it 
personally, but I'm loath to do that unnecessarily ...



   thoughts?
   Ben Bolker

---

(Some previous history omitted here for brevity; there had been a bit of 
back-and-forth about this package previously.)


  07/30: Submitted version 1.1.2.2 of the glmmTMB package.  Got a 
"pretest-waiting-recheck" message asking us to confirm that we had 
addressed issues; I responded the same day.


  08/04, 08/06: Tried to confirm that the message was received (maybe I 
was too pushy?) -- no answer that I have seen.


  The CRAN queue in general seems to be moving OK 
(foghorn::cran_incoming(), 'archive' folder filtered out, sorted by 
time: 57 total, 45 from today or yesterday).


   package  versioncran_folder time
   
 1 BIRDS0.2.1  pending 2021-07-21 17:01:00
 2 glmmTMB  1.1.2.2waiting 2021-07-30 20:29:00
 3 PEcAn.logger 1.8.0  waiting 2021-08-05 18:58:00
 4 IPDFileCheck 0.7.4  waiting 2021-08-06 11:15:00
 5 R6   2.5.1  waiting 2021-08-06 22:27:00
 6 ibdreg   0.3.3  pending 2021-08-06 23:41:00
 7 mark 0.2.0  waiting 2021-08-08 23:25:00
 8 DataGraph1.2.3  pending 2021-08-09 03:11:00
 9 tibble   3.1.4  waiting 2021-08-09 05:46:00

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel