[R] Silly Question

Ott Toomet siim at obs.ee
Thu Apr 18 11:46:08 CEST 2002


I am not quite sure, but as I understand you have a file (like "foo.R")
containing some commands like

cat("Hello world\n")
f2 <- function(x) x*x

when saying 

> source("foo.R")

you get message

Hello world

and you get also the function f defined.  So simply say 

> f(4)

to get 16.

Was it what you wanted?


On Thu, 18 Apr 2002, [iso-8859-1] Ricardo Gonçalves wrote:

  |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

More information about the R-help mailing list