[R] access objects

Berry Boessenkool berryboessenkool at hotmail.com
Wed Sep 7 19:53:51 CEST 2011



hi,

say I have consecutively numbered objects obj1, obj2, ... in my R workspace.
I want to acces one of them inside a function, with the number given as an argument.

Where can I find help on how to do that? Somebody must have been trying to do this before...
Some keywords to start a search are appreciated as well.

Here's an example, I hope it clarifies what I'm trying to do:

obj1 <- 7:9
obj2 <- 6:2
testf <- function(k) plot(  noquote(paste("obj", k, sep=""))  )
testf(1) # should plot obj1



-------------------------------------
Berry Boessenkool
D-14476 Potsdam (OT Golm)
-------------------------------------
 		 	   		  


More information about the R-help mailing list