R/new_order.R

Defines functions new_order

Documented in new_order

#' Reorder vector using factor levels
#'
#' @param vector vector to be reordered
#' @param order vector with new order of elements
#' 
#'
#' @return reordered vector of factors
#'
#' @examples
#' 
#'
#' @export
new_order <- 
  function(vector, order) {
  
  factor(vector, levels = order)
  
}
ktbaek/krisr documentation built on Feb. 21, 2022, 12:07 a.m.