Hi All
When you print a function constructed within a function, R prints it's
environment.
For example:
> myfunction = function ()
+ { f = function () NULL
+ attributes (f) = list (class="myfunction", myattribute=1)
+ f
+ }
> myfunction.f = myfunction ()
> myfunction.f
function ()
NULL
<environment: 0x03fcbc30>
attr(,"class")
[1] "myfunction"
attr(,"myattribute")
[1] 1
One way to prevent this is to set the function's environment to the global
environment.
But I was wondering if there's a way to stop R from printing the
environment without changing the environment?
kind regards
Abs
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.