Skip to content

referencing values of strings

6 messages · Apoian, Zack, Dimitris Rizopoulos, Brian Ripley +3 more

#
get("x") see also r-FAQ 7.21

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Apoian, Zack" <Zack.Apoian at sac.com>
To: "'R-help at lists.R-project.org'" <R-help at stat.math.ethz.ch>
Sent: Wednesday, November 17, 2004 4:48 PM
Subject: [R] referencing values of strings
#
On Wed, 17 Nov 2004, Apoian, Zack wrote:

            
?get
#
"get" is your friend:

R> x <- c( 1, 2, 3 )
R> get( "x" )
[1] 1 2 3

All the best,
Arne
On Wednesday 17 November 2004 16:48, Apoian, Zack wrote:

  
    
#
On Wed, Nov 17, 2004 at 10:48:46AM -0500, Apoian, Zack wrote:
get("x")

See ?get.  You may also be interested in ?assign.

+ seth
#
On Wed, 2004-11-17 at 10:48 -0500, Apoian, Zack wrote:
If I am understanding you correctly:

x <- 1:10
[1]  1  2  3  4  5  6  7  8  9 10

x.char <- "x"
[1]  1  2  3  4  5  6  7  8  9 10


See ?get for more information.

HTH,

Marc Schwartz