[R] organizing work; dump function

Friedrich Leisch Friedrich.Leisch at ci.tuwien.ac.at
Thu Sep 28 16:46:23 CEST 2000


>>>>> On Thu, 28 Sep 2000 15:54:01 +0200,
>>>>> RINNER Heinrich (RH) wrote:

>> Dear R-users!
>> 
>> I am using R 1.0.0 and Windows NT 4.0
>> 
RH> In the past I have used several different working directories for different
RH> projects, and during many of these projects I have written some functions
RH> for particular purposes. Now I thought I would be nice to have all these
RH> "personal" functions collected in one place, and to make them available in R
RH> no matter which working directory I use.

RH> Reading the manual "An Introduction to R Version 1.0.0", chapter 10.8
RH> ("Customizing the environment"), I guess the (best ?) way to this is to dump
RH> all my functions into one big file "myfunctions.R" and source that into R
RH> via a .First function in my Rprofile file.

RH> But, when I write new functions and want to add these to my personal
RH> collection "myfunctions.R", it would be nice to have something like
>> dump("new.function", file="myfunctions.R", append=TRUE).
RH> AFAIK this isn't possible (there is no append argument to dump), so I guess
RH> I have to create new files each time and then copy these together somehow.

RH> So my questions are:
RH> 1) Does this way to organize ones functions make sense, or are there better
RH> alternatives?

I personally have a private package of functions, which has the
advantage that the various workspaces are not polluted by copies of
the functions (if you source() code, it gets into the global
environment, packages maintain their own environment).

RH> 2) If it makes sense, wouldn't an "append" argument to "dump" be a useful
RH> thing?

Yes, independent of the above usage.  I'll add the feature in the
devel version.

Best,

-- 
-------------------------------------------------------------------
                        Friedrich  Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071      Friedrich.Leisch at ci.tuwien.ac.at
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
     PGP public key http://www.ci.tuwien.ac.at/~leisch/pgp.key
-------------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list