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
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",
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","C","D","E","F")
for(i in c(1:length(my_list))){
url<- "http://finance.yahoo.com";
doc = htmlTreeParse(url, useInternalNodes = T)
tab_nodes
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
I am using the normtemp data set in UsingR package. I want to store all
normtemp[,1] from 1 to 65 as x and normtemp[,1] from 66to 130 as y. How do I
write code to do that from here:
> data(normtemp)
--
View this message in context:
http://r.789695.n4.nabble.com/Using-a-for-loop-tp3896903p3896
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
Dear R users,
I am completelly lost with the following:
I have the following vectors a, b ,c, d and e
+ a
[1] 279.3413 268.0450 266.3062 433.8438 305.4650 317.4712 288.3413
374.6950
>
> b
[1] 170.4500 254.5675 219.5762 232.3425 200.2738 238.2637 210.6062
262.4825 345.2387 269.3763
[11] 190
7 matches
Mail list logo