powered by
Move a vector n elements forward or backward.
move_n_point(x, n = 1, na_value = NA)
A vector.
Number indicating how many steps the vector should shift forward (N > 0) or backward (n < 0).
The value to replace the empty cells with (e.g., the first or last points). Defaults to NA.
A vector with the same length of x, all moved n steps.
x
n
Other Utility functions: findAbsMin(), find_n_neighbors(), firstLetterCap(), getArrowPos(), getDec(), getRange(), getRatioCoords(), get_palette(), group_sort(), inch2coords(), isColor(), list2str(), orderBoxplot(), se(), sortGroups()
findAbsMin()
find_n_neighbors()
firstLetterCap()
getArrowPos()
getDec()
getRange()
getRatioCoords()
get_palette()
group_sort()
inch2coords()
isColor()
list2str()
orderBoxplot()
se()
sortGroups()
# NOT RUN { (x <- -10:30) prev <- move_n_point(x) change <- x - prev post5 <- move_n_point(x, n=-5) emptyPlot(length(x), range(x)) lines(x) lines(prev, col='red') lines(post5, col='blue') # }
Run the code above in your browser using DataLab