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), ...)]

Try the ecospace package in your browser

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

ecospace documentation built on July 8, 2020, 5:54 p.m.