Q:

Convert string to numeric in R

This seems likely to have a simple solution but I am having a hard time getting it. How do I convert this string to numeric?
> a <- "1:10"

Desired solution should be
> 1:10
[1]  1  2  3  4  5  6  7  8  9 10

I have tried as.numeric() (doesn't work), strsplit ":" and getting the end points 1 and 10 (can work but seems clumsy) but is there some simpler way? Thanks. 

A:

You can use eval() and parse()
eval(parse(text ="1:10"))

