Skip to content
Prev 102415 / 398500 Next

Using a string as a variable name

On 10/20/2006 7:28 PM, Jason Horn wrote:
Yes, you want

foo <- "var1"
frame[ ,foo]

(i.e. return the foo column from frame, indexing frame as though it was 
a matrix).

Duncan Murdoch