Message-ID: <5813F35C93514CE09C0DA6980744A289@TCPC000>
Date: 2008-12-09T17:44:21Z
From: Mark Heckmann
Subject: no implicit call of the print function within loops?
Dear R-users,
I wonder why some functions produce output when they are called (I suppose
due to an implicit call of the print function) but within a loop they do
not:
attach(anscomce)
exp <- parse(text= "lm(x1 ~ y1)")
eval(exp)
Here the print() function seems to be called implicitly.
If I do the same within a for-loop, it is not.
for (i in c(1)){
eval(exp)
}
I know that I have to wrap it into a print function so it would work.
But why is that so? In the eval() help I don't find any clues.
As this happens with other functions as well, I would like to understand the
causes and thus
avoid some future mistakes.
TIA,
Mark