I am wondering if there is a generic way in R to create character vectors from a template where the values of another vector are expanded in an arbitrary number of times.
That is, I am looking for a function like tq84(template, vec)
that I could call with tq84('foo_%d, bar_%d, baz_%d', 1:2)
and then results in the vector "foo_1, bar_1, baz_1", "foo_2, bar_2, baz_2"
. Note that the length of the resulting vector should be equal to the length of the input vector.