R/DEPRECATED-isample.R

Defines functions isample

# Function -------------------------------------------------------------------

#' @name DEPRECATED-isample
#' @concept deprecated
#'
#' @title (DEPRECATED)
#'        Return vector of row indices
#'
#' @description
#'
#' This function is **deprecated**.
#' Use `sample(..., index = TRUE)` instead.
#'
#' @param ... Arguments to [hyperSpec::sample()].
#'
#' @export

isample <- function(...) {
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  hySpc_deprecated("sample(..., index = TRUE)")
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sample(..., index = TRUE)
}


# Unit tests -----------------------------------------------------------------

hySpc.testthat::test(isample) <- function() {
  context("isample")

  test_that("deprecated",  expect_warning(isample(flu), "deprecated"))
}
r-hyperspec/hyperSpec documentation built on May 31, 2024, 5:53 p.m.