R/test.R

Defines functions test.lequal

Documented in test.lequal

#' Test All Equal Within List
#'
#' This function tests whether all elements in a list are identical.
#'  Works like an iterative \code{all.equal}.
#'
#' @param list A list.
#' @export
test.lequal <- function(list){

  for(i in 1:length(list)){
    if(!identical(list[1], list[i])){
      stop("Element", i, "does not match the first.")
    }}
}
tpq/miSciTools documentation built on Sept. 16, 2019, 4:43 p.m.