Skip to content
Prev 205791 / 398506 Next

Arguments of a function

Try this:

my.f <- function(a, b) {
	x1 <- 2 * 3
      x2 <- 3 / 6
      x3 <- 4 * 4 / 5 - sqrt(2)
	y <- get(deparse(substitute(a))) + get(deparse(substitute(b)))
	return(y)
}

my.f(x1, x2)
On Fri, Jan 8, 2010 at 4:15 PM, Lisa <lisajca at gmail.com> wrote: