Skip to content

define stuff to be only usable in the same file

5 messages · Jessica Streicher, Duncan Murdoch

#
Hello R-Help!

I've looked around and have not found:

A simple(short) way to hide functions and variables from the global environment. What i want is for a few of them to only be accessable from the scriptfile they're in. I probably could do fun things with environments , but that seems quite a hassle.

As example: I have a file that gets me stuff from the database and creates an R object from the results, plus some functions on that object. Now i want the objectrelated stuff to be global, while the functions and variables i use for accessing the database shall be hidden.
#
On 12-07-10 9:13 AM, Jessica Streicher wrote:
The simplest and best way to do this is to write a package.  You can 
also use local() around the code in a script, but it gets messy when you 
want to export more than one thing.

Duncan Murdoch
#
On 10.07.2012, at 16:45, Jessica Streicher wrote:

            
Forget about that, i'm stupid and can't use the tools available...
#
Packaging ist still too complicated for my level i guess, can't get it to work properly, and it seems a lot of work.

However apparently putting a "." in front of functions will hide them, saw that in another script, don't know what its about, but it works, so who cares..
On 10.07.2012, at 17:02, Jessica Streicher wrote: