You could make your question "more beautiful" by paying greater attention to capitalization, spelling, and grammar.
–
BondedDustSep 30 '12 at 7:02

@Dason, can you please post your comment as an answer so Dada Lili can accept it as solved?
–
Roman LuštrikSep 30 '12 at 8:07

@RomanLuštrik Looks like there are good enough answers now. I was just tired and didn't feel like writing up an answer. Although to be honest of this is a duplicate (or at least close enough to a duplicate) or something I would surprised.
–
DasonSep 30 '12 at 15:17

The gsubfn package can do string interpolation somewhat along the lines of Perl if we preface the function whose arguments are to contain substitutions with fn$. Here $x means substitute in the value of x . See ?fn and the gsubfn home page.

Is x a "reserved" name? I'm asking because x <- 1; fn$print('$x') returns "NA" (though no warning) while it works as expected i.e., returns "1" if I name the variable something else. Seems like a bug to me.
–
flodelSep 30 '12 at 16:19

1

x <- 1; fn$print("$x") works for me. Are you using an old version of gsubfn? The latest version is 0.6.4.
–
G. GrothendieckSep 30 '12 at 16:26

I was using 0.6.3. I confirm it works under 0.6.4, my bad.
–
flodelSep 30 '12 at 17:20