[R] functions and getting them into R

Jens Nieschulze jniesch at gwdg.de
Mon May 27 18:16:37 CEST 2002


On Mon, 27 May 2002, Guy Forrester wrote:

%Dear All,
%
%I am new to R and can see it is a very powerful and versatile system for
%programming and statistical analysis.
%
%Say I have written a simple function and want to use it on a regular
%basis. I have the file as a text file say 'c:\R-funcs\func.txt' how do I
%get R to find it on the hard disc or alternatively where is the default
%location for looking up functions where I can place this file.  eg where
%are functions such as var(), mean() etc stored?  
%
%At the moment I'm pasting the text of the function into the GUI prompt,
%not very satisfactory if it is to be used in a programme.

maybe
R>source("path/to/text/file")
does the trick?

%
%Please forgive any naivety on my part as I am just starting out
%
%Many thanks in advance 
%
%Guy
%
%
%----------------------------------------------------------------------
%Guy J. Forrester			Phone:  01453 860777
%CSL Research Unit			Fax:    01453 860132
%Woodchester Park			e-mail:  g.forrester at csl.gov.uk		
%Nymsfield				
%Stonehouse
%Gloucestershire				
%GL10 3UJ	    			http://www.csl.gov.uk
%----------------------------------------------------------------------
%
%Disclaimer
%The information contained in this message may include privileged,
%proprietary or confidential information. Please treat it with the same
%respect that you would expect for your own information.  If you have
%received it in error, we apologise, and ask that you contact the CSL
%sender immediately and erase it from your computer. Thank you for your
%co-operation.
%
%Further information on confidentiality of our communications, can be
%found at http://www.csl.gov.uk/email.htm
%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
%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
%_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
%

***********************************************************************
Jens Nieschulze

Institute for Forest Biometrics &	Phone: ++49-551-39-12107
Applied Computer Science		Fax  : ++49-551-39-3465
Buesgenweg 4
37077 Goettingen		E-mail: jniesch at uni-forst.gwdg.de
GERMANY				http://www.uni-forst.gwdg.de/~jniesch

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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