This is my data
Assay Sample Dilution meanresp number
1 S 0.25 68.55 1
1 S 0.50 54.35 2
1 S 1.00 44.75 3
My end goal is to apply a linear regression to every two consecutive rows and return the slope of that regression using Dilution and meanresp.
The length of the table can vary and i'd prefer not to use for loops as i'm trying to get out of the habit.
I think ddply would be good, but i'm not sure how to select the subset of every two consecutive rows. I thought perhaps there could be a way of saying 'do this for every vector subset of Dilution of length 2?
Any insight would be helpful.