1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/other.R
\name{sample_seq}
\alias{sample_seq}
\title{Sampling a random integer sequence}
\usage{
sample_seq(low, high, length)
}
\arguments{
\item{low}{The lower limit of the interval (inclusive).}
\item{high}{The higher limit of the interval (inclusive).}
\item{length}{The length of the sample.}
}
\value{
An increasing numeric vector containing integers, the sample.
}
\description{
This function provides a very efficient way to pull an integer random sample
sequence from an integer interval.
}
\details{
The algorithm runs in \code{O(length)} expected time, even if
\code{high-low} is big. It is much faster (but of course less general) than
the builtin \code{sample} function of R.
}
\examples{
rs <- sample_seq(1, 100000000, 10)
rs
}
\references{
Jeffrey Scott Vitter: An Efficient Algorithm for Sequential
Random Sampling, \emph{ACM Transactions on Mathematical Software}, 13/1,
58--67.
}
\seealso{
Other other:
\code{\link{convex_hull}()},
\code{\link{running_mean}()}
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\concept{other}
\keyword{datagen}
|