Mengembalikan perbedaan yang tertinggal dan terulang dengan tepat.
diff(x, …)<p></p><p># S3 method for default
diff(x, lag = 1, differences = 1, …)</p><p># S3 method for POSIXt
diff(x, lag = 1, differences = 1, …)</p><p># S3 method for Date
diff(x, lag = 1, differences = 1, …)</p>
| Parameter | Deskripsi |
|---|---|
x |
a numeric vector or matrix containing the values to be differenced. |
lag |
an integer indicating which lag to use. |
differences |
an integer indicating the order of the difference. |
… |
further arguments to be passed to or from methods. |
# NOT RUN {
diff(1:10, 2)
diff(1:10, 2, 2)
x <- cumsum(cumsum(1:10))
diff(x, lag = 2)
diff(x, differences = 2)
diff(.leap.seconds)
# }