R/sample2.R

Defines functions sample2

Documented in sample2

#' Internal Ecospace Functions.
#'
#' Internal functions not intended to be called directly by users.
#'
#' Corrects behavior when object sampled has unit length. This is the same
#' function proposed in help file of \code{sample} as \code{resample}.
#'
#' @param x Either a vector of one or more elements from which to choose, or a positive integer.
#' @param ... arguments for particular methods.
#'
#' @seealso \code{\link[base]{sample}}
#'
#' @export
sample2 <- function(x, ...)
  x[sample.int(length(x), ...)]
pnovack-gottshall/ecospace documentation built on June 14, 2020, 1:04 p.m.