This seems like an easy one (and it probably is), but since I’m braindead, I’m ready to get on the shame wall.
How to copy a list object n times, and wrap it up in a list afterwards? Something like this:
list(foo = "", bar = 0)
in order to get:
list(
list(foo = "", bar = 0),
list(foo = "", bar = 0)
)
NOTE:
for loops are considered cheating
Well,
repworks (and is “vectorized”) if you simply wrap the list in another list…That trick can also be used to assign
NULLto an element in a list: