I think this is a super quick thing, but I figured I\'d ask since I can\'t for the life of me remember how to do it...
Suppose, I have a data.frame (call it, DF
DF
DF$foo[1] tries to return the first element of the column named foo (which doesn't exist). You want DF[foo[1]].
DF$foo[1]
foo
DF[foo[1]]