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
Hello, I tried loop to modify the list, but unfortunately it was not successful.  But, I found another way to get the result you wanted (at least from what I understand). #Here are the datasets cats<-read.table(text=" name eats_kg 1 bob 3 2 garfield 4 3 chuck 6 ", sep="",header=TRUE) dogs<-read

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:--