R/list.reverse.R

Defines functions list.reverse

Documented in list.reverse

#' Reverse a list
#'
#' @param .data A \code{list} or \code{vector}
#' @export
#' @examples
#' x <- list(a=1,b=2,c=3)
#' list.reverse(x)
list.reverse <- function(.data) {
  .data[rev.default(seq_along(.data))]
} 

Try the rlist package in your browser

Any scripts or data that you put into this service are public.

rlist documentation built on Sept. 5, 2021, 5:30 p.m.