Readers, For a matrix: 1 10 20 30 2 15 40 60 3 20 80 120 Using a spreadsheet, a differential function can be applied to the data as a formula: |(10-15)/(1-2)| ... repeated for each pair of adjacent values What is the corresponding function in R please? Is it better to write a new function, or to use some form of function 'diff'?