Grokbase Groups R r-help April 2002
FAQ
(I reply to Mark's reply as I went too fast
deleting the original message).

Ricardo,

Assuming your text file "saludos.R" has 2 R functions, i.e.

"hola" <- function()
{
print ("HOLA")
}

"adios" <- function()
{
print ("ADIOS")
}

if you do in R:
source("/directory_info/saludos.R")
functions hola() and adios() will become
available in your def. environment
as you can check with ls(), and just
run as hola() and adios().

(I think the problem might be that source() is
used for two very different goals: run a demo
and "load" functions strored in ascii files.
The name "source" seems not intuitive for the
second purpose and often confuses beginers).


Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es

On Thu, 18 Apr 2002, Mark Myatt wrote:

Ricardo Gonçalves <ricardo@icmc.sc.usp.br> writes:
After I source an R code, how can I call the function?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
groupr-help @
categoriesr
postedApr 18, '02 at 3:16a
activeApr 18, '02 at 12:28p
posts4
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase