R/check_if_args_identical.R

Defines functions check_if_args_identical

Documented in check_if_args_identical

#' Check if arguments are identical before stop

# DESCRIPTION ##################################################################
#' @description
#' This function checks if two different sets of arguments are identical

# ARGUMENTS ####################################################################
#' @param args_a \code{List} first list of arguments
#' @param args_b \code{List} second list of arguments
#' @param names_to_check \code{Vector} with the names of arguments to be checked

#' @author Alberto Castro & Axel Luyten

#' @keywords internal



check_if_args_identical <- function(args_a, args_b, names_to_check) {

  # Compare values
  checked_values <-
    purrr::map_lgl(names_to_check, ~ identical(args_a[[.x]], args_b[[.x]])) |>
    stats::setNames(names_to_check)  # Name the result

  return(checked_values)
}

Try the healthiar package in your browser

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

healthiar documentation built on March 12, 2026, 5:07 p.m.