Re: [R] "NOTE" warning

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Tue, 20 May 2008 06:43:32 -0400

On 20/05/2008 6:27 AM, Mikis Stasinopoulos wrote:
> Dear all
>
> I am using NAMESPACE in my package but I would like the user to be able
> to overwrite four functions:
> own.linkfun, own.linkinv, own.mu.eta and own.valideta.
> These are used to defined "own" link functions.
>
> Is there any way of doing that without getting the when I am checking
> the package?

In your own code, you could explicitly "get" them. For example,

own.linkfun <- get("own.linkfun", env=globalenv())   ...

However, this isn't a great design. What if the user wants to work on two different models, with different link functions? It would be better to pass the functions (or a list containing them) to your code as arguments to the call to your function. That's how glm() does it.

Duncan Murdoch

> This is what I am getting:
> make.link.gamlss : linkfun: no visible binding for global variable
> 'own.linkfun'
> make.link.gamlss : linkinv: no visible binding for global variable
> 'own.linkinv'
> make.link.gamlss : mu.eta: no visible binding for global variable
> 'own.mu.eta'
> make.link.gamlss : valideta: no visible binding for global variable
> 'own.valideta'
>
> Thanks
>
> Mikis Stasinopoulos
>
>
> Companies Act 2006 : http://www.londonmet.ac.uk/companyinfo
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 20 May 2008 - 11:04:23 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 Tue 20 May 2008 - 11:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive