Re: [R] calculations combining values from different rows

2012-02-09 Thread William Dunlap
Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Sebastián Daza > Sent: Thursday, February 09, 2012 6:26 PM > To: r-help@r-project.org > Subject: [R] calculations combining values from different rows > > Hi everyone, &

[R] calculations combining values from different rows

2012-02-09 Thread Sebastián Daza
Hi everyone, I looking for functions or systematic ways to do calculations between different columns and rows in R, as one can do easily in Excel. For example, I have two variables, a and b, where a1 represents an a value in row 1, and b2 represents a b value in row 2, etc. a <- c(4,3,5,5,6,7,3,2