[R] row subtraction

Ben Bolker bolker at ufl.edu
Mon Oct 26 01:00:27 CET 2009

Marsha Melnyk wrote:
> I don't know if there is a way to do this in R but I want to subtract 
> within the same column from different rows.  I want to subtract 
> c(r)-c(r-1) and continue down the column until they are all calculated 
> and form another column. Again I don't know if R can do this but I 
> thought I would ask.

Can't tell quite what you want -- can you give an example?

Does apply(X,2,diff) do it?

View this message in context: http://www.nabble.com/row-subtraction-tp26052146p26053157.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list