>
> Hello everyone,
>
> I have the following R code for a multivariable function:
>
>
> > fn2<-function(x,y,z){(y+2*z)/(5*y-x*z)}
> >
> > fn2(-5,-2,3)
> [1] 0.8
>
>
>
> No problems.
>
> ===
>
> If, however, I call the function using a vector substitution for the
> arguments, R sees this as 3 separate calls to the function while supplying
> only the first argument:
>
> > in2<-c(-5,-2,3)
> > in2
> [1] -5 -2  3
> >
> > fn2(in2)
> Error in fn2(in2) : argument "y" is missing, with no default
>
> ===
>
> How should I call the function using the vector substitution method so that
> R sees that this is a single call to the function that supplies all 3 of the
> arguments?
>
> Thank you,
>
> Dan
>
>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to