R - indirectly calling a matrix using a string

Posted by Boris Senderovich on Stack Overflow See other posts from Stack Overflow or by Boris Senderovich
Published on 2011-02-26T22:40:09Z Indexed on 2011/02/26 23:24 UTC
Read the original article Hit count: 193

Filed under:

Example: There is a matrix of data called VE There is a vector of string where the first element is the string VE. I need to indirectly call the string and be able to access data. For example if I need the 6th column of matrix VE then I want to do:

Vector[1][,6]

Essentially I need R to start reading those string as if they are the matrix names that are already in this page. I need this syntax to be dynamic because I am putting it in a loop.

© Stack Overflow or respective owner

Related posts about r