Re: [Rd] package check note: no visible global function definition (in functions using Tcl/Tk)

From: Prof Brian Ripley <>
Date: Thu, 14 Jun 2007 16:14:23 +0100 (BST)

On Mon, 11 Jun 2007, Seth Falcon wrote:

> Prof Brian Ripley <> writes:
>> It seems that is happens if package tcltk is missing from the Depends:
>> list in the DESCRIPTION file. I just tested with Amelia and homals and
>> that solved the various warnings in both cases.
> Adding tcltk to Depends may not always be the desried solution. If

But I didn't say it was (I didn't mention a solution at all). What I did say was that it happened if 'tcltk' was missing (which implies that it should have been there), and gave two of the tens of instances of this on CRAN. You may prefer the version now in R-devel: this goes slightly the other way in that it loads all the Suggests/Enhances packages and also a dummy compatibility package for platform differences. Neither this nor the previous version can test the conditionalization is correct, as the code is analysed but no path through it is run. It is entirely possible that the problems flagged are in code that can never be reached: this shows up dramatically in examples such as Hmisc with non-R code (for S3 or S4).

> tcltk is already in Suggests, for example, and the intention is to
> optionally provide GUI features, then the code may be correct as-is.
> That is, codetools will issue the NOTEs if you have a function that
> looks like:
> f <- function() {
> if (require("tckltk")) {
> someTckltkFunctionHere()
> } else
> otherwiseFunction()
> }
> }
> There are a number of packages in the BioC repository that provide
> such optional features (not just for tcltk) and it would be nice to
> have a way of declaring the use such that the NOTE is silenced.
> [Note 1: I don't have any ideas at the moment for how this could
> work.]
> [Note 2: Despite the false-positives, I've already caught a handful of
> bugs by reading over these NOTEs and think they provide a lot of value
> to the check process]
> + seth

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Thu 14 Jun 2007 - 15:58:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Jun 2007 - 22:35:01 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.