Related: Strings as variable references in R Possibly related: Concatenate expressions to subset a dataframe
I\'ve simplified the question per the comment
The basic answer to the question in the title is eval(as.symbol(variable_name_as_string)) as Josh O'Brien uses. e.g.
eval(as.symbol(variable_name_as_string))
var.name = "x" assign(var.name, 5) eval(as.symbol(var.name)) # outputs 5
Or more simply:
get(var.name) # 5