Similar questions have been raised for other languages: C, sql, java, etc.
But I'm trying to do this in R.
I have:
ret_series <- c(1, 2, 3)
x <- "ret_series"
How do I get (1, 2, 3)
by calling some function / manipulation on x
, without direct mentioning of ret_series
?
You provided the answer in your question. Try get
.
> get(x)
[1] 1 2 3