Below are a few problems I have encountered with the new checks being done in R-devel. 1/ I have two generics, test.equal and test.equal.tframe. The first checks that two objects are equal while the second checks if two objects have equal tframes (time frames). There is no reason these should have similar arguments but the check seems to think that test.equal.tframe is a method for test.equal so I get: * checking generic/method consistency ... WARNING test.equal: function(obj1, obj2, ...) test.equal.tframe: function(tf1, tf2) 2/ I have some generics which may or may not already be defined (e.g. lag would be defined if library ts is attached) so in my R code I use if (!exists("lag")) lag <- function(x, ...) { UseMethod("lag") } but this results in Objects with usage in file `.../tframe/man/lag.tframe.Rd' but missing from code: [1] "lag" Is there a better way to approach this in my R code so I don't get these warnings? 3/ I have a few general introduction .Rd files which do not have a usage line and they produce * checking for undocumented arguments in \usage ... WARNING Error in parse(file, n, text, prompt) : parse error Error in checkDocArgs(dir = ".../syskern") : cannot source usages in file .../syskern/man/00Intro.syskern.Rd Execution halted Should that be expected or is it a bug? Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 28 Sep 2001, Paul Gilbert wrote:> Below are a few problems I have encountered with the new checks > being done in R-devel. > > 1/ I have two generics, test.equal and test.equal.tframe. The > first checks that two objects are equal while the second checks > if two objects have equal tframes (time frames). There is no > reason these should have similar arguments but the check seems to > think that test.equal.tframe is a method for test.equal so I get: > > * checking generic/method consistency ... WARNING > test.equal: > function(obj1, obj2, ...) > test.equal.tframe: > function(tf1, tf2)There is a stop list in checkMethods, but naming one generic to look like a method of another is surely peverse. -- Brian D. Ripley, ripley@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-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> Paul Gilbert writes:> Below are a few problems I have encountered with the new checks > being done in R-devel.> 2/ I have some generics which may or may not already be defined > (e.g. lag would be defined if library ts is attached) so in my R > code I use> if (!exists("lag")) lag <- function(x, ...) { UseMethod("lag") }> but this results in> Objects with usage in file `.../tframe/man/lag.tframe.Rd' but > missing from code: > [1] "lag"> Is there a better way to approach this in my R code so I don't > get these warnings?Use library(ts) in the package's .First.lib instead. Or help improving the logic in checkMethods(): currently we only eval top-level *assignments* in the R code. Otherwise, we have problems with code used for creating save images calling e.g. dyn.load.> 3/ I have a few general introduction .Rd files which do not > have a usage line and they produce> * checking for undocumented arguments in \usage ... WARNING > Error in parse(file, n, text, prompt) : parse error > Error in checkDocArgs(dir = ".../syskern") : > cannot source usages in file > .../syskern/man/00Intro.syskern.Rd > Execution halted> Should that be expected or is it a bug?The version of dse I have access to in fact has \usage{library("syskern")} Using the current logic, extract-usage thinks this documents the usage of function library(), and hence translates to library <- function("syskern") which gives the syntax error. Using library(syskern) will work but give a warning about the undocumented argument `syskern'. In an ideal world we would not have to rely on heuristics but have <usage> <s-code>...</s-code> </usage> alas we do not have that yet. [More precisely: we would also know what kind of topic was documented, and exclude documentation for packages from the function checking.] With the advent of the new documentation engine nowhere in sight, maybe we should have a markup like \IAmNotSCode{...} for taking care of the above. -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._