From hb at stat.berkeley.edu  Tue Jun 12 00:42:30 2007
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Tue, 12 Jun 2007 00:42:30 +0200
Subject: [Rd] package check note: no visible global function definition
	(in functions using Tcl/Tk)
In-Reply-To: <m2abv6v3ba.fsf@ziti.local>
References: <466D5A0F.2090907@tu-dresden.de>
	<Pine.LNX.4.64.0706111638530.22283@gannet.stats.ox.ac.uk>
	<m2abv6v3ba.fsf@ziti.local>
Message-ID: <59d7961d0706111542gc599d04q576f3f8d9a4a782e@mail.gmail.com>

On 6/11/07, Seth Falcon <sfalcon at fhcrc.org> wrote:
> Prof Brian Ripley <ripley at stats.ox.ac.uk> 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
> 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.

Same scenario here: I am using Suggest and I found that the NOTEs go
away if you call the function with double-colon (::), e.g.
tcltk::someTckltkFunctionHere().

I also got several NOTEs about non-declared objects if I used
request(<pkgname>), but they go away with request("<pkgname>").

>
> [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]

I second this. I recently found a lot of typos, bugs, and "left overs"
in my code thanks 'codetools'.  It's a great tool - thanks!

Henrik

>
> + seth
>
> --
> Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
> http://bioconductor.org
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



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