#' Left-right order
#'
#' Order the numbers 1 through \code{n}, starting at index \code{i} and
#' proceeding rightward then leftward.
#'
#' @param n A positive integer.
#' @param i An integer between 1 and \code{n}.
sort_rightleft <- function(x, i) {
n <- length(x)
ord <- rightleftorder(n, i)
x[ord]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.