?? hmm ??
At 16:17 10/09/01 +0100, you wrote:
Hello again!
thanks to all who helped with overlay plots - v. easy in the end.
Anyway, another new(ba)bee type question - the gurus will cringe I'm sure!
Q. simple R function
mm <- function (u) {
x <- u$GDP
x
m <- mean(x)
m
}
When the function is called the vector "x" does not get printed from within
the function, but the mean value "m" does, why?
I think it's probably to do with scoping but don't really know.
The vector "x" can of course be printed with the print function so there no
problem seeing it for program debugging etc.
Thanks in advance.
Gerard Keogh
If you want to have the results just printed, you can modify your function
by adding print(x):
mm <- function (u) {
x <- u$GDP
print(x)
m <- mean(x)
m
}
Emmanuel Paradis
Laboratoire de Pal?ontologie
Institut des Sciences de l'?volution
Universit? Montpellier II
F-34095 Montpellier c?dex 05
France
phone: +33 4 67 14 39 64
fax: +33 4 67 14 36 10
mailto:paradis at isem.univ-montp2.fr
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._