[R] Manipulating code?

Seth Falcon sfalcon at fhcrc.org
Tue May 23 19:26:14 CEST 2006

Johannes Hüsing <johannes at huesing.name> writes:

> Dear expeRts,
> I am currently struggling with the problem of finding
> cut points for a set of stimulus variables. I would like
> to obtain cut points iteratively for each variable by
> re-applying a dichotomised variable in the model and then
> recalculate it. I planned to have fixed names for the
> dichotomised variables so I could use the same syntax
> for every recalculation of the whole model. I furthermore
> want to reiterate the process until no cut point changes
> any more.
> My problem is in accomplishing this syntactically. How can
> I pass a variable name to a function without getting lost
> in "as.symbol" and "eval" and "parse" mayhem? I am feeling
> I am thinking too much in macro expansion à la SAS when
> trying to tackle this.

I think a simple example of what you are trying to do might be needed.

But take a look at the help pages for assign() and get().  These
functions make it easy to go from string containing name of variable
to the actual variable, etc.

+ seth

More information about the R-help mailing list