Re: [R] (Newbie) scope of with()

From: Deepayan Sarkar <>
Date: Thu 15 Jul 2004 - 22:11:32 EST

On Thursday 15 July 2004 03:01, Antonio Prioglio wrote:
> Hi list,
> 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
> participant$longfieldname[$longfieldname)]<-expr(...
>) or similar that makes cumbersome reading. (participant is a table of
> demographic data)
> If there a neat way to do something of the sort
> "participant<-with(participant,{...})"

You may want to take a look at ?transform

Deepayan mailing list PLEASE do read the posting guide! Received on Thu Jul 15 22:43:39 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:59 EST