[R] Apply a multi-variable function to a vector

S Ellison S.Ellison at LGCGroup.com
Tue Sep 13 13:43:33 CEST 2016

> I would like to define an arbitrary function of an arbitrary number of variables,
> for example, for 2 variables:
> func2 <- function(time, temp) time + temp
> I'd like to keep variable names that have a meaning in the problem (time and
> temperature above).

Not quite enough information here.

If we called 
func2(30, 298, 23)

which has an arbitrary third argument, what would you like to happen to the third argument? And a fourth, fifth and so on? Something consistent for all arguments, or something different for each depending on its (arbitrary) name?

S Ellison

This email and any attachments are confidential. Any use...{{dropped:8}}

More information about the R-help mailing list