[Rd] Namespace and function open

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Feb 18 19:15:49 CET 2008


On Mon, 18 Feb 2008, Martin Maechler wrote:

>>>>>> "MS" == Markus Schmidberger <schmidb at ibe.med.uni-muenchen.de>
>>>>>>     on Fri, 15 Feb 2008 15:47:16 +0100 writes:
>
>    MS> Hello, I built a package, everything was working very
>    MS> well. Now I included a NAMESPACE to export only some
>    MS> variables. (export(f, g, ...) ) Everything is working
>    MS> fine, except one function. There I get an error:
>
>    MS> Fehler in UseMethod("open") : keine anwendbare Methode
>    MS> für "open"
>
>    MS> In this function I use the function "open" to generate
>    MS> an output bar.
>
>    MS> * if (verbose) { pbt <- new("ProgressBarText",
>    MS> length(ids), barsteps = as.integer(20)) open(pbt) }
>
>    MS>     for (i in seq(along=ids)) {
>
>    MS>       if (verbose) { update(pbt) }
>
>    MS> How I have to change my NAMESPACE file to fix this
>    MS> problem?
>
> You also have to export the *methods* for the open() generic:
>
> exportMethods("open")

He doesn't say he created any.  I think more likely he did not import the 
S4 generics & methods from the BioC package 'affy'.  Since open() is in 
the base namespace, it will be found instead of any such-named function 
in another package unless imported.

But really we need a lot more information: package 'affy' is not even 
mentioned, if it is indeed the source of class "ProgressBarText".
As so often, the output of sessionInfo() (as mentioned in the posting 
guide) is the 'at a minimum' information needed.

>
>
>    MS> Thanks Markus Schmidberger
>
> you're welcome,
> Martin Mächler
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at 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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-devel mailing list