R - get all variables created from function call -
It's crazy, and only with intellectual curiosity: can I run a function in R such that after the function Can I get all the variables created when the function is executed? So the ability to see a function before coming back? I do not mean to enter the function in debug mode.
I'm not sure what it is you want, but maybe close to you Trace can embed an intermediary expression:
& gt; Trace (Lm, exit = function). Last_env & lt; & Lt; - "LM" tracing function "statistics" in parent.frame ()) package [1] "LM" & gt; LM (y ~ x, data.frame (x = 1: 10, y = 10: 1)) LM on exit call (y ~ x, data.frame (x = 1:10, y = 10: 1)) Tracing: LM (formula = y ~ x, data = data. Frames (x = 1:10, y = 10: 1)) Coefficient: (interception) x 11 -1 & gt; LS (.last_env) [1] "cl" "contradiction" "data" "formula" "m" method "mf" model "" mt "" na.action "" offset "[12]" qr "ret.x" "Ret.y" "singular.ok" "subset" or "weight" "x" "y" "z" & gt; ("Cl", .last_env) LM (formula = y ~ x, data = data.frame (x = 1:10, y = 10: 1)) < / Html>
Comments
Post a Comment