[R] Data in an object = Existing Objects??

Huntsinger, Reid reid_huntsinger at merck.com
Tue Mar 1 20:32:18 CET 2005


If you have the name of an object, you can use "get" to get the object
itself. 

You didn't ask, and I don't know what your intended use is, but this looks
like a difficult and inefficient way to keep track of things in R. You may
want to look over some of the R introductions (on www.r-project.org) to see
other ways to represent your data. For example, perhaps a two-way array C
such that e.g. your C_05_04 is the 5,4 entry. R is good at handling arrays
and more importantly, you won't have to deal with constructing strings and
breaking them apart again, using "get" and "assign" to get and assign to
objects with these names, etc. 

Reid Huntsinger

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of
achilleas.psomas at wsl.ch
Sent: Tuesday, March 01, 2005 11:53 AM
To: r-help at stat.math.ethz.ch
Subject: [R] Data in an object = Existing Objects??


Dear R-help...

I am rather new so I would appreciate your help..
My question if the following..

I have generated (with R) a data frame DF looking like this..

> print(DF)
       X1      X2
2   C_05_04 C_05_11
3   C_05_04 C_05_17
4   C_05_04 C_06_08
5   C_05_04 C_06_29
6   C_05_04 C_07_16


Where "C_05_04"....and all the rest data are objects-names already
calculated
and existing in my R workspace...
What i tried to do (and i doesnt work) is the following
e.g

x1 <- DF[1,1]
  C_05_04

(Where C_05_04 exists as an object in the workspace )
and then try to apply any kind of function using this x1
Is there a way to specify that x1 should be concidered as an object and not
just
as data ?


I hope i have explained clearly enough my question..

I would appreciate any help.

Achilleas.

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




More information about the R-help mailing list