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

2012-06-29 Thread arun
Message - From: Jan Näs j...@plattfot.com To: r-help@r-project.org Cc: Sent: Thursday, June 28, 2012 5:10 AM Subject: [R] loop through and modify multiple data frames 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

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

2012-06-29 Thread arun
Cc: Sent: Thursday, June 28, 2012 5:10 AM Subject: [R] loop through and modify multiple data frames 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

[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

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