[R] How to get the source code for the assignment of a variable?

blue sky bluesky315 at gmail.com
Fri Feb 12 06:40:38 CET 2010


'get' can give me the source code for a function. Is there a way to
get the source code for a variable? In the following example, the
source code for x is 'y*y'. Is there a way to get it using the string
'x'?


> f=function(){print('xx')}
> get('f')
function(){print('xx')}
> y=3
> x=y*y
> get('x')
[1] 9



More information about the R-help mailing list