I'm migrating some Excel and Access functions into R and am having trouble figuring out equations that are simple in Excel.
I have a data frame containing a numerical column, e.g.
x
06
12
20
28
34
I want to create a new column (y) containing the solution to i+1-i and apply it down the column. In Excel this would simply be =A3-A2 copied down the column, but I can't figure it out in R.
I'm sure the solution is very simple, but this is only my second day of learning R and despite hours of searching I can't find the answer!