[R] Executable expressions
Sarah Goslee
sarah.goslee at gmail.com
Wed Jan 18 22:24:38 CET 2012
> mytext <- "c(1,2,3,4,5)"
> a <- eval(parse(text=mytext))
> a
[1] 1 2 3 4 5
will do this, if there's no better way to accomplish your actual goal.
Sarah
On Wed, Jan 18, 2012 at 4:18 PM, Ajay Askoolum <aa2e72e at yahoo.co.uk> wrote:
> Given
>
> a<-"c(1,2,3,4,5)"
>
> How can I evaluate the variable a to return a (numeric) vector comprising of 1,2,3,4,5? Thanks.
>
> [[alternative HTML version deleted]]
>
>
--
Sarah Goslee
http://www.functionaldiversity.org
More information about the R-help
mailing list