Re: [R] Hiding a function

2008-02-23 Thread Hans-Peter
> > After some private email with some high level programmer (Gabor), I have shouldn't that rather be: high in knowledge but low in level? Best, Hans-Peter [[alternative HTML version deleted]] ___

Re: [R] Hiding a function

2008-02-23 Thread Christophe Genolini
After some private email with some high level programmer (Gabor), I have the solution and I can answer to my own question :-) The problem was 1° to define a function B( ) available only in a function A( ) (for code safeness) and 2° to define B( ) elsewhere than in A( ) (for code readability)

Re: [R] Hiding a function

2008-02-23 Thread Duncan Murdoch
On 23/02/2008 8:22 AM, Christophe Genolini wrote: > Ok, I saw FUNx > So, I reformulate my question : is there a way, without nesting b( ) in > a( ), to make b( ) available only in a( ) ? Not that I know of. It will be available to anything using the same environment as a(), which in the case of

Re: [R] Hiding a function

2008-02-23 Thread Christophe Genolini
Ok, I saw FUNx So, I reformulate my question : is there a way, without nesting b( ) in a( ), to make b( ) available only in a( ) ? > Just to clarify, what Duncan was referring to as the > alternative was nesting the definition of one function > in another, e.g. look at FUNx in by.data.frame -- > F

Re: [R] Hiding a function

2008-02-23 Thread Gabor Grothendieck
Just to clarify, what Duncan was referring to as the alternative was nesting the definition of one function in another, e.g. look at FUNx in by.data.frame -- FUNx is available to by.data.frame but is not visible outside of by.data.frame . On Sat, Feb 23, 2008 at 6:09 AM, Duncan Murdoch <[EMAIL PRO

Re: [R] Hiding a function

2008-02-23 Thread Christophe Genolini
Gabor Csardi a écrit : > It depends what you mean by 'hiding', Well, the main idea was the to limit the existance of a function. a( ) need b( ) but no other function will need b(). So I would have like to let b( ) exists localy only when a( ) is called, not elsewhere. Christophe > you can start

Re: [R] Hiding a function

2008-02-23 Thread Gabor Csardi
It depends what you mean by 'hiding', you can start the function names with a dot and then they are not listed by ls(), so this is kind of hiding. > .a <- function() TRUE > ls() character(0) > .a function() TRUE Personally i would not do this though. G. On Sat, Feb 23, 2008 at 11:58:57AM +0100

Re: [R] Hiding a function

2008-02-23 Thread Duncan Murdoch
On 23/02/2008 5:58 AM, Christophe Genolini wrote: > Duncan Murdoch a écrit : >> On 23/02/2008 5:15 AM, Christophe Genolini wrote: >>> Hi the list >>> >>> Is it possible to 'hide' a function from the user ? I cut a big >>> fonction in sub >>> function and I would like to hide the sub function, jus

Re: [R] Hiding a function

2008-02-23 Thread Christophe Genolini
Duncan Murdoch a écrit : > On 23/02/2008 5:15 AM, Christophe Genolini wrote: >> Hi the list >> >> Is it possible to 'hide' a function from the user ? I cut a big >> fonction in sub >> function and I would like to hide the sub function, just like if I >> declare them >> in the big function : >> >

Re: [R] Hiding a function

2008-02-23 Thread Duncan Murdoch
On 23/02/2008 5:15 AM, Christophe Genolini wrote: > Hi the list > > Is it possible to 'hide' a function from the user ? I cut a big > fonction in sub > function and I would like to hide the sub function, just like if I > declare them > in the big function : > > -- > a <- function(x

[R] Hiding a function

2008-02-23 Thread Christophe Genolini
Hi the list Is it possible to 'hide' a function from the user ? I cut a big fonction in sub function and I would like to hide the sub function, just like if I declare them in the big function : -- a <- function(x){ b <- function(y){y^2} d <- function(y){y^3} b(x)+d(x)+2 } a(2