Python has the *(...)
syntactic sugar. Can you do this in R?
t = (2010, 10, 2, 11, 4, 0, 2, 41, 0) dt = datetime.datetime(*t[0:7])
From here: https://stackoverflow.com/a/2238361/1007926
This allows each element of the tuple to be assigned to an argument of, in this case, the datetime
function.
An analogous trick in R might look like this, if the syntax were the same as Python:
lims <- c(10,20)
my.seq <- seq(*lims)
I don't believe this exactly the same as "unpacking" used in this question:
>>> a, b, c = (1, 2, 3)
Is there a way to do it in R, as below?
a, b, c = c(1, 2, 3)