[R] How to perform arithmetic across rows

Nick Ackerman nick.ackerman at pgn.com
Thu Oct 28 20:47:55 CEST 2010


Hi All,

I have a data frame (myframe) with variables (columns) A,B,C and 100 records
(rows) for each. Column A is numeric. I would like to append a column to
myframe that subtracts the value in row 24 of A from row 1 of A. In this
procedure the first 23 rows of the new column will necessarily be blank
(NA). Can anyone provide guidance for me here?

Thanks in advance for your time.

Nick
-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-perform-arithmetic-across-rows-tp3017905p3017905.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list