diff() does not work on data.frames so you need to give it a column
from the data.frame, as a vector.
diff(data.frame(P=c(1,2,3,5,7,11,13,17))$P)
[1] 1 1 2 2 4 2 4
You get different errors for multi- and single-column data.frames
> diff(data.frame(P=c(1,2,3,5,7,11,13,17),
Dear R users,
I have a txt file entitled coc composed by one column of numeric values
without header and having 50 rows. This file is under the following path:
C:\\Users\\intel\\Documents\\TR
I have written the following lines:
2 matches
Mail list logo