From ripley at stats.ox.ac.uk  Mon Feb 18 19:15:49 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 18 Feb 2008 18:15:49 +0000 (GMT)
Subject: [Rd] Namespace and function open
In-Reply-To: <18361.48869.656651.59207@stat.math.ethz.ch>
References: <47B5A5F4.7080809@ibe.med.uni-muenchen.de>
	<18361.48869.656651.59207@stat.math.ethz.ch>
Message-ID: <Pine.LNX.4.64.0802181808570.2809@auk.stats>

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


[Rd] Namespace and function open
Prof Brian Ripley