Hi!
In python, one can define variables in the form x1, x2, x3 = f(y)
, where the function f returns a tuple.
Is there anything similar in R? It'll be quite useful in many situations, like defining similar type of variables simultaneously.
For example, say I have a discrete dataset and I want to do something with its frequency distribution. Then table
returns frequency of all the distinct values. One may can simply define f1, f2, etc simultaneously, instead of
f1 <- table(data)[1]
f2 <- table(data)[2]
# etc
Thanks