Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/r-utility-shift.R
This function shifts vector elements to the right, filling the new first position with a specified value. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.
1 | shift.right(v, first = NA)
|
v |
a vector |
first |
a value to be inserted at the first position after shifting |
All vector elements are shifted to the right: the original v[length(v)]
disappears, the original v[length(v)-1]
becomes the new v[length(v)]
,
etc. The new v[1]
value is set to first
(defaulting to NA
).
The shifted version of v
.
Pawel Cichosz <p.cichosz@elka.pw.edu.pl>
1 | shift.right(1:10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.