Displaying 1 result from an estimated 1 matches for "fargs1".
Did you mean:
  args1
  
2006 Jan 20
1
Passing variable arguments to functions
Hi,
Is there another  way to pass arguments via a vector to arbitrary functions
as in the following code example without using a series of if else
statements?
f <- test(func, x, parms, fargs1, fargs2, ...)
{
   # parms is a vector of parameters to func.
   #  ... is for use by f, not by func.
   n <- length(parms)
   if (n == 0)         y <- func(x)
  else if (n == 1)   y <- func(x, parms[1])
  else if (n == 2)   y <- func(x, parms[1], parms[2])
 # remaining body of f follo...