[R] Turning a string into an expression

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Mon Mar 3 14:41:03 CET 2003


> aaa <- "list(1,2,3,4)"
> parse(text=aaa)
expression(list(1, 2, 3, 4))

On Mon, 3 Mar 2003, Søren Højsgaard wrote:

> Dear all,
> I have e.g. 
> 	aaa <- "list(1,2,3,4)" 
> and would like to get a hold on the list 
> 	list(1,2,3,4)
> from aaa. Can anyone help with that?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list