Skip to content
Back to formatted view

Raw Message

Message-ID: <1100712642.2495.13.camel@horizons.localdomain>
Date: 2004-11-17T17:30:42Z
From: Marc Schwartz
Subject: referencing values of strings
In-Reply-To: <D35A7FAE1220DB49A018F51A225565E8059FA3@mailisny3.saccap.int>

On Wed, 2004-11-17 at 10:48 -0500, Apoian, Zack wrote:
> Say you have a vector named x and a function which returns the character
> string "x" .  How would I take "x" as an input and return the vector x?


If I am understanding you correctly:

x <- 1:10

> x
 [1]  1  2  3  4  5  6  7  8  9 10

x.char <- "x"

> get(x.char)
 [1]  1  2  3  4  5  6  7  8  9 10


See ?get for more information.

HTH,

Marc Schwartz