(As an exercise) I was trying to emulate some languages such as perl, etc by assigning to multiple variables in R.
my ($a, $b, $c) = ( 1, 2, 3 );
now $a is 1, $b is 2, $c is 3.
I expected this to work:
mapply(assign, c('A', 'B', 'C'), 1:3)
But it just returned a named int vector of 1,2,3.
Why didn't this work as expected?
Edit: First part of my question was indeed a duplicate of: Assign multiple new variables on LHS in a single line in R but would still like to know why my approach of mapply/assign didn't work.