knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) pkgload::load_all()
The goal of wrswoR is to provide faster implementations of weighted random sampling without replacement in R.
You can install the released version of wrswoR from CRAN with:
install.packages("wrswoR")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("krlmlr/wrswoR")
The functions in this package are a drop-in replacement to sample.int(n, size, replace = FALSE, prob = prob)
.
With large n
, sample.int()
becomes too slow to be practical, unlike the functions in this package.
library(wrswoR) set.seed(20200726) sample_int_crank(20, 10, 1:20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.