Skip to content
Prev 298669 / 398498 Next

loop through and modify multiple data frames

Hi Jan,

Glad it helped you in some way.? I am also copying to rhelp as your solution might be useful for future reference.

A.K.



----- Original Message -----
From: Jan N?s <skydiver.jan at gmail.com>
To: arun <smartpink111 at yahoo.com>
Cc: 
Sent: Friday, June 29, 2012 5:02 AM
Subject: Re: [R] loop through and modify multiple data frames

Thank you, this helped a bit on the way. I managed to loop through the
data frames by haveing an array with data frame names (ex animals <-
("cats","dogs"...etc) ) same as names in the list, to get the results
and also split it up back into separate data frames which I was after.
something like this ex:

for(i in 1:length(animals)){
assign(animals[i] , cbind(as.data.frame(myList[i]), cost))
}

/Jan

2012/6/29 arun <smartpink111 at yahoo.com>:
Message-ID: <1340975513.15823.YahooMailNeo@web39404.mail.mud.yahoo.com>
In-Reply-To: <CACJbS5JoD1So53tBOjRti7rDq9mp2CL5Ys7VBQgEW77woEhZsQ@mail.gmail.com>