Vectors Representing Random Variables
Overview
Random vectors, called rvecs. An rvec holds multiple draws, but tries to behave like a standard R vector, including working well in data frames. Rvecs are useful for analysing output from a simulation or a Bayesian analysis.
New functions
- Added
extract_draws()for selection by index, including repeated indices, andthin_draws()for random selection without replacement in original order. - Added
draws_any_na(),draws_all_na(),draws_any_infinite(),draws_all_infinite(),draws_any_finite(), anddraws_all_finite()to check missingness and finiteness across draws for each element. pmin()andpmax()now accept rvecs in any argument position for elementwise bounds and comparisons within each draw. Calls without rvecs retain base R behaviour.which.min()andwhich.max()now find the first extreme position within each draw. Empty rvecs return empty index rvecs; nonempty draws with no valid index returnNAwith one summary warning per call. Ordinary inputs retain base R behaviour.
Show all changes in 1.0.5Hide the rest of the changes in 1.0.5
Constructors
new_rvec_chr(),new_rvec_dbl(),new_rvec_int(), andnew_rvec_lgl()now accept a scalarvalueto fill all elements and draws, includingNA. Existing defaults are unchanged.
Summaries
draws_ci()now acceptspoint = "mean"to report a mean point estimate; the default remainspoint = "median"and interval limits are unchanged.min(),max(), andrange()now summarise elements independently within each draw, including multiple arguments and missing-value handling.quantile()now calculates quantiles independently within each draw, preserving base R's probability, missing-value, naming, and algorithm options.
Bug fixes
rank()now preserves fractional average ranks for tied values instead of failing when converting them to integers. Logical rvecs also use a compatible ranking method, and singleton and empty inputs retain their original draw counts.
Documentation
- Improved documentation for draw summaries and resolved a roxygen warning about matrix multiplication methods while retaining support for R < 4.3.
Clarifying interface
- Internal functions now enforce the (previously implicit) constraint that rvecs must have at least one draw. Rvecs of length 0 (ie with 1+ columns but 0 rows internally) continue to be allowed.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- NOTE12 OK, 1 NOTE2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 50includes a package overview page
- Examples that run
- 100%47 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 91%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 79
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Releases over time
Issues over time
Commits over time
10 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/bayesiandemography/rvec on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-02 · The repository has a site deploy workflow
pkgdown site last built 2026-10-02
Show all practicesHide 1 practice
Dependencies
Installing rvec adds 13 packages (9 with compiled code, 4.4 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, cli 629 KB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.0.5Latest2026-10-02 · current release · diff ↗ ·
added 12 exports
draws_all_finite, draws_all_infinite, draws_all_na, draws_any_finite, draws_any_infinite, draws_any_na, extract_draws, pmax, pmin, thin_draws, which.max, which.min - RR 4.6.0 released · 2026-04-24
- 1.0.12026-02-15 · diff ↗
- 1.0.02025-12-10 · diff ↗ ·
added 8 exports
draws_cv, draws_sd, draws_var, new_rvec_chr, new_rvec_dbl, new_rvec_int, new_rvec_lgl, pool_draws - 0.0.8
- RR 4.5.0 released · 2025-04-11
- 0.0.7
- RR 4.4.0 released · 2024-04-24
- 0.0.62023-11-08
- RR 4.3.0 released · 2023-04-21
Package metadata
- First published
- 2023-11-08
- Total releases
- 6 / 3 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.2.0
- Bundled data
- 175 KB / 2 files
- Download size
- 429 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("rvec")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.