SkillAgentSearch skills...

WrswoR

A package with different implementations of weighted random sampling without replacement in R

Install / Use

/learn @krlmlr/WrswoR
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<!-- README.md is generated from README.Rmd. Please edit that file -->

wrswoR

<!-- badges: start -->

Lifecycle:
stable R build
status Codecov test
coverage CRAN
status

<!-- badges: end -->

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

Installation

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")

Example

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)
#>  [1]  8 18 14 17 11 15 10  4 13  5
View on GitHub
GitHub Stars20
CategoryDevelopment
Updated11d ago
Forks2

Languages

TeX

Security Score

75/100

Audited on Mar 20, 2026

No findings