[BioC] Question about turning strings into variable names in R

STKH (Steen Krogsgaard) StKH at novozymes.com
Thu Mar 1 13:34:49 CET 2007


 eval(parse(text=v[1]))

cheers
Steen

-----Original Message-----
From: bioconductor-bounces at stat.math.ethz.ch
[mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of
J.delasHeras at ed.ac.uk
Sent: 1. marts 2007 13:22
To: bioconductor at stat.math.ethz.ch
Subject: [BioC] Question about turning strings into variable names in R


Hi,

I have a situation where I have a vector of variable names. If I call
any of them, I get a text string (the name is surrounded by ""). How can
I use that as a variable name again?

For instance, I have objects a, b and c, and a vector v<-c("a","b","c").
If I want to return the contents of a, I can't do just v[1], because
that only shows "a"...
Is there a simple way to indicate that "a" should be taken as the name
of an object, and not as a string? If so, I haven't found it...

thanks!

Jose

-- 
Dr. Jose I. de las Heras                      Email:
J.delasHeras at ed.ac.uk
The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK

_______________________________________________
Bioconductor mailing list
Bioconductor at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/bioconductor
Search the archives:
http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list