[R] How to take out the content of character string

baptiste auguie baptiste.auguie at googlemail.com
Wed Mar 10 09:30:44 CET 2010


Hi,

it's generally considered a bad practice but try this,

eval(parse(text=AA))

library(fortunes)
fortune(106)

HTH,

baptiste

On 10 March 2010 07:46, jq81 <jingqian81 at gmail.com> wrote:
>
> My question is represented by the following example.
>
> For example, I have a character string a, which is defined as
>
> AA="list(x=1, y=2)"
>
> I want to take out the content of AA by using some function, so that I can
> obtain the following expression automatically.
>
> list(x=1, y=2)
>
> Does anyone know how to do it? Thanks a lot,
>
>
>
>
>
>
>
>
> --
> View this message in context: http://n4.nabble.com/How-to-take-out-the-content-of-character-string-tp1587004p1587004.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
____________________

Baptiste Auguié

Departamento de Química Física,
Universidade de Vigo,
Campus Universitario, 36310, Vigo, Spain

tel: +34 9868 18617
http://webs.uvigo.es/coloides



More information about the R-help mailing list