On Friday June 9 2006 16:06, Sundar Dorai-Raj wrote:
> Larry Howe wrote:
>
> This works because "x" exists in the function "f". Perhaps you want this
> instead?
>
> f <- function(x) {
> print(deparse(substitute(x)))
> print(exists(deparse(substitute(x))))
> print(is.null(x))
> invisible()
> }
Your example code works, but when I try to apply it to my function, it does
not behave as expected. My variable seems to exist before I pass it into the
function, but once inside the function it does not exist.
I guess what I need is an in-depth guide to functions: scoping, arguments,
parameters, etc. I am also becoming curious about how to pass values out of a
function. Can someone point me in the right direction?
Larry
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html