I am trying to loop and rename colnames in a data frame.
How can I embed a numeric variable in the R's colname string. I found the .(x) associated to the bquote/paste method for title in graphics but it doesn't work with a standard string.
In Ruby I can embed a variable in a string using #{x} in the following way
irb(main):005:0> (1..10).each{|i| p "hello no #{i}"}
"hello no 1"
"hello no 2"
"hello no 3"
"hello no 4"
"hello no 5"
"hello no 6"
"hello no 7"
"hello no 8"
"hello no 9"
"hello no 10"
Thanks
paste? There is alsosprintfbut that's probably overkill.pasteandsprintfare vectorized, so you might not even need the loop.