My code
source("mycustomfunction.R")
mycustomfunction(10,35,3)
returns
45
My function does this:
mycustomfunction <- function (input1,input2,input3) {
output1 = input1+ input2
output2 = input3
return(output1)
return(output2)
}
In Matlab, for example, LHS of your function declaration lists all output variables as such
[var1 var2] = function(input1, input2)
So the calling script gets var1 and var2 back if the call is made also like this
[a b] = namefunction(1,2)
But how is this done in R?