[R] (Newbie) scope of with()
a.prioglio at city.ac.uk
Thu Jul 15 10:01:53 CEST 2004
As I understand statements within with() are local to what is enclosed
within its expression.
As some excellent examples given to me previously have illustrated it is
nevertheless possible to assign the evaluation of an expression to an
external variable like x <- with(data, if(..))
During a "normalisation" phase of data read from a database I have a long
list of statements of the type
or similar that makes cumbersome reading. (participant is a table of
If there a neat way to do something of the sort
it would make nicer reading.
Apparently attach(), detach() would not do as
creates a new variable and not a change to the value of the field!
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST MS ATTACHMENTS
More information about the R-help