Movatterモバイル変換


[0]ホーム

URL:


wrswoR

Lifecycle: stableR build statusCodecov test coverageCRAN status

The goal of wrswoR is to provide faster implementations of weightedrandom sampling without replacement in R.

Installation

You can install the released version of wrswoR fromCRAN with:

install.packages("wrswoR")

And the development version fromGitHub with:

# install.packages("devtools")devtools::install_github("krlmlr/wrswoR")

Example

The functions in this package are a drop-in replacement tosample.int(n, size, replace = FALSE, prob = prob). Withlargen,sample.int() becomes too slow to bepractical, unlike the functions in this package.

library(wrswoR)set.seed(20200726)sample_int_crank(20,10,1:20)#>  [1]  8 18 14 17 11 15 10  4 13  5

[8]ページ先頭

©2009-2025 Movatter.jp