I really don't know how R functions works! It doesn't work like matlab that we can return and also call many objects of our function?
I'm writting a function inwhich I need to have more than one outcome, but it returns me just one. I wonder how the R programmers can write such functions. For example: sort
s<-sort(c(10:3, 2:12), method = "shell", index.return = TRUE)
s$x
s$ix
As we see we can call two external objects(x: sorted vector , ix: index of the sorted vector)
Also I can't understand when I want to see inside the written function in R. for example for a simple function like "mean" we have:
> mean
function (x, ...)
UseMethod("mean")
<bytecode: 0x0000000017c57d28>
<environment: namespace:base>
Thanks en advance
Nafis