Re: [R] Controlling visibility of top-level functions

2014-02-03 Thread Greg Snow
One option that I have not seen mentioned yet, and may be the most similar to the Python approach is to name the "Invisible" function starting with a "." (the period). Then the function will not appear when you do `ls()` but is still accessible. It however is not limited in scope and it is still

Re: [R] Controlling visibility of top-level functions

2014-01-31 Thread Duncan Murdoch
On 14-01-31 5:09 PM, Rolf Turner wrote: On 01/02/14 08:13, Duncan Murdoch wrote: On 31/01/2014 1:46 PM, Paul A. Steckler wrote: I'm fairly new to R, and have checked the R FAQ and done an RSiteSearch for help on this topic, to no avail. I want to write some R code that has functions at the top

Re: [R] Controlling visibility of top-level functions

2014-01-31 Thread Bert Gunter
I think you will find that using namespaces and export directives are a better way of controlling visibility with packages. That is their intended purpose. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And know

Re: [R] Controlling visibility of top-level functions

2014-01-31 Thread Paul A. Steckler
Thanks for the suggestions. I'm going to need to create an R package, eventually, so I'll use that mechanism to control visibility. -- Paul On Fri, Jan 31, 2014 at 11:13 AM, Duncan Murdoch wrote: > On 31/01/2014 1:46 PM, Paul A. Steckler wrote: >> >> I'm fairly new to R, and have checked the R

Re: [R] Controlling visibility of top-level functions

2014-01-31 Thread Rolf Turner
On 01/02/14 08:13, Duncan Murdoch wrote: On 31/01/2014 1:46 PM, Paul A. Steckler wrote: I'm fairly new to R, and have checked the R FAQ and done an RSiteSearch for help on this topic, to no avail. I want to write some R code that has functions at the top-level that are not visible when the code

Re: [R] Controlling visibility of top-level functions

2014-01-31 Thread Duncan Murdoch
On 31/01/2014 1:46 PM, Paul A. Steckler wrote: I'm fairly new to R, and have checked the R FAQ and done an RSiteSearch for help on this topic, to no avail. I want to write some R code that has functions at the top-level that are not visible when the code is loaded. So in fun1 <- function(...

[R] Controlling visibility of top-level functions

2014-01-31 Thread Paul A. Steckler
I'm fairly new to R, and have checked the R FAQ and done an RSiteSearch for help on this topic, to no avail. I want to write some R code that has functions at the top-level that are not visible when the code is loaded. So in fun1 <- function(...) { ... } fun2 <- function(...) { ... fun1 ..