Skip to content

[R-pkg-devel] Fwd: CRAN packages maintained by you

2 messages · Jens Oehlschlägel, Ege Rubak

#
Hi, I was asked by CRAN-maintainers to provide two versions of 
median.integer64, one with and one without a dots-argument.

However, doing so results in a code-documentation mismatch, because I have

\method{median}{integer64}(x, na.rm = FALSE)

and now also need

\method{median}{integer64}(x, na.rm = FALSE, \dots)

but selecting between both using \Sexpr{} seems not to be allowed in a 
Rd-usage-section.

Anyone knows the proper way to do this?


Jens Oehlschl?gel



-------- Forwarded Message --------
Subject: 	CRAN packages maintained by you
Date: 	Thu, 23 Mar 2017 18:08:18 +0100
From: 	Kurt Hornik <Kurt.Hornik at wu.ac.at>
Reply-To: 	CRAN at R-project.org
To: 	achim.zeileis at r-project.org, andri at signorell.net, claudio at unive.it, 
edzer.pebesma at uni-muenster.de, j.curran at auckland.ac.nz, 
jens.oehlschlaegel at truecluster.com, jouni at kerman.com, mx.herve at gmail.com
CC: 	CRAN at R-project.org



Dear maintainers,

This concerns the CRAN packages

   Bolstad DescTools RVAideMemoire bit64 circular rv units zoo

maintained by one of you:

   Achim Zeileis <Achim.Zeileis at R-project.org>: zoo
   Andri Signorell <andri at signorell.net>: DescTools
   Claudio Agostinelli <claudio at unive.it>: circular
   Edzer Pebesma <edzer.pebesma at uni-muenster.de>: units
   James Curran <j.curran at auckland.ac.nz>: Bolstad
   Jens Oehlschl?gel <Jens.Oehlschlaegel at truecluster.com>: bit64
   Jouni Kerman <jouni at kerman.com>: rv
   Maxime Herv? <mx.herve at gmail.com>: RVAideMemoire

You may already have noticed that under r-devel these have given
warnings like

* checking S3 generic/method consistency ... WARNING
median:
   function(x, na.rm, ...)
median.Bolstad:
   function(x, na.rm)

for some time now, following

      \item \code{median()} gains a formal \code{\dots} argument, so
       methods with extra arguments can be provided.

Could you please update your package code to eliminate these warnings,
ideally as quickly as possible?

In one package co-developed by me, I went for

if(is.na(match("...", names(formals(median))))) {
     median.tuple <- function(x, na.rm = FALSE) {
         x <- as.numeric(x)
         NextMethod()
     }
} else {
     median.tuple <- function(x, na.rm = FALSE, ...) {
         x <- as.numeric(x)
         NextMethod()
     }
}

which may be the "simplest" way forward ...

Best
-k
#
Hi,
We had this issue with `median.im` in spatstat. I wasn't involved in 
fixing it, but maintainer Adrian Baddeley changed the documentation 
according to CRAN instructions. You can see it here:
https://github.com/spatstat/spatstat/blob/master/man/mean.im.Rd
Maybe you can use that for inspiration...
Cheers,
Ege
On 04/15/2017 12:02 AM, Jens Oehlschl?gel wrote: