R/test_match_order.R

Defines functions test_match_order

Documented in test_match_order

#' Function to check whether two vectors are in the same order or not. 
#'
#' @param x,y
#' @keywords data_processing
#' @export
#' @examples
#' test_match_order()

test_match_order <- function(x,y) {
  
  if (all(x==y)) print('Perfect match in same order')
  
  if (!all(x==y) && all(sort(x)==sort(y))) print('Perfect match in wrong order')
  
  if (!all(x==y) && !all(sort(x)==sort(y))) print('No match')
}
siggitrausti/siggitRausti documentation built on Sept. 9, 2020, 3:36 p.m.