Re: [R] loop through and modify multiple data frames

2012-06-29 Thread arun
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 To: arun Cc: Sent: Friday, June 29, 2012 5:02 AM Subject: Re: [R] loop through and modify multiple data frames Thank

Re: [R] loop through and modify multiple data frames

2012-06-28 Thread arun
0.5   7.5 2 Trud 0.4   6.0 3 Sind 0.6   9.0 4  Rav 0.8  12.0 There might be an easy way in loop to get the same result. A.K. ----- Original Message - From: Jan Näs To: r-help@r-project.org Cc: Sent: Thursday, June 28, 2012 5:10 AM Subject: [R] loop through a

Re: [R] loop through and modify multiple data frames

2012-06-28 Thread Tal Galili
Hi Jan, You can do it in two ways. The simplest one is the following. The first option is to use $. Here is how: dogs <- data.frame(a = 1:10, b = 10:1) dogs$c <- dogs$a+dogs$b dogs The second way it to use ?within Contact Details:--

[R] loop through and modify multiple data frames

2012-06-28 Thread Jan Näs
Hi Newbie question: I have a set of data frames that I want to do the same calculations on each. I've found out that I can put them in a list and loop through the list to do the calculation, but not put the results back into each data.frame.. For example three data frames cats, dogs, birds wher