Re: [R] Using a FOR LOOP to name objects

2012-02-29 Thread michaelyb
Michael - thank you so much! Just what I needed! -- View this message in context: http://r.789695.n4.nabble.com/Using-a-FOR-LOOP-to-name-objects-tp4430454p4433903.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org ma

Re: [R] Using a FOR LOOP to name objects

2012-02-29 Thread R. Michael Weylandt
In short, don't -- use a named list instead. Long answer: ?assign ?get Michael On Tue, Feb 28, 2012 at 10:40 PM, michaelyb wrote: > Hello, > > I am trying to use a for loop to name objects in each iteraction. As in the > following example (which doesn't work quite well) > > my_list<-c("A","B",

Re: [R] Using a for loop

2011-10-11 Thread Joshua Wiley
You should read the posting guide again (at all?). Among other things, it suggests you should show what you have tried doing that did not work (worst case it shows us you tried to figure it out on your own before asking other people to freely give their time to solve your problems, at best case, w

Re: [R] using a for loop with variable as vectors

2009-02-27 Thread baptiste auguie
Hi, you could do one of the following, 1) combine a, b, c, d, e in a list and use ?lapply my.list <- list(a,b,c,d,e) lapply(my.list, foo) where foo() is a function to be applied to each individual element 2) alternatively, see ?get to retrieve the value of a variable from its name. Your