R/check_sampling_method.R

Defines functions check_sampling_method

Documented in check_sampling_method

#' Checks if the \code{sampling_method} is a valid
#' sampling method. See \link{rkt_get_sampling_methods}
#' for a vector of valid sampling methods
#' @inheritParams default_params_doc
#' @export
check_sampling_method <- function(sampling_method) {
  if (length(sampling_method) != 1) {
    stop(
      "'sampling_method' must be one sampling method. \n",
      "Actual value: ", sampling_method
    )
  }
  if (!sampling_method %in% rkt_get_sampling_methods()) {
    stop(
      "'sampling_method' must be a sampling method. \n",
      "Actual value: ", sampling_method
    )
  }
}
richelbilderbeek/raket documentation built on Dec. 31, 2019, 7:41 p.m.