Turn code into function

Possibly, because R has no scalars, only vectors. :wink:

In your example, if you call f with [2,3], then x will be a tuple ([2, 3],), so sum will sum this tuple.

No; also there are no “environments” in the R sense in Julia.

I would recommend that you start from the basics, and work through the Julia manual first. Trying to adapt R concepts to Julia will just be a source of continuous frustration.

Also, please quote your code.

3 Likes