Changelog
Source:NEWS.md
rvec 1.0.5
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.
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.
rvec 1.0.4
Memory use
- Reduced temporary memory use in constructors, casts, arithmetic, comparisons, logical math, summaries, covariance, weighted summaries,
if_else_rvec(),draws_mode(), draw pooling, and expansion by avoiding unnecessary copies and repeated data, while preserving existing behavior.
rvec 1.0.3
Memory use
Distribution functions use less temporary memory by retaining shared parameters in compact form and avoiding unnecessary input and output matrix copies. The changes cover all distribution families supported by rvec and preserve results, warnings, and random-number generator behavior, apart from the bug fixes below. Random output remains double-valued.
Calculations continue to use the same base R distribution functions, including the distinction between omitted and explicitly supplied
ncp. Negative binomial conversion frommutoprobavoids intermediate rvecs while retaining the same arithmetic.Multinomial functions retain compact inputs and the existing order of base R calls.
rmultinom_rvec()allocates double output directly, anddmultinom_rvec()avoids an unnecessary copy when calculating default size for standard double rvecs.
Bug fixes
Hypergeometric density, probability, and quantile functions correctly name
nandkwhen their draw counts are incompatible; the error previously namedktwice.Random-generation functions such as
rgamma_rvec()now correctly recycle single-draw rvec parameters when another parameter has multiple draws andn_drawis omitted. Previously, if the first rvec parameter had a single draw, the call failed with an internal length error after advancing the random-number generator state.
rvec 1.0.1
CRAN release: 2026-02-15
Reducing minimum R version
- The minimum R version has been reduced from 4.3.0 to 4.2.0. However, it does not appear to be possible to safely implement matrix multiplication without
matrixOps, which was introduced in 4.3.0. Methods for matrix multiplication are therefore only implemented if R >= 4.3.0.
rvec 1.0.0
CRAN release: 2025-12-10
Change to lifecycle status
- Interface is now sufficiently stable that the “experimental” lifecycle badge has been removed.
Changes to interface
- Added functions
draws_sd(),draws_var(),draws_cv()for summarising across draws. (#37) - Added function
pool_draws(), for combining draws across categories. (#35) - Added functions
new_rvec_chr(),new_rvec_dbl(),new_rvec_int(), andnew_rvec_lgl(). Deprecated functionnew_rvec(). The new functions initialise a vector with 0, ““, orFALSE, whilenew_rvec()initialised it withNA, which was awkward. (#36) - Added quotation marks to printed rvec_chr objects.
- Added
%*%method forMatrix::Matrixobjects. (#31)
Documentation
- Removed warning about r* functions returning doubles. (#28)
rvec 0.0.8
CRAN release: 2025-07-13
Changes to interface
- Added function
prob(), a version ofdraws_mean()that works only with logical rvecs. (#27) -
rvec()andrvec_dbl()now accept sparse matrices (inheriting from “Matrix”), in addition to dense matrices. (#25) - Function
rbinom_rvec(),rgeom_rvec(),rhyper_rvec(),rmultinom_rvec(),rnbinom_rvec(), andrpois_rvec()now always return doubles, even when the counts are small. The standard R approach of giving integers when counts are small and doubles when counts are large was generating Valgrind errors in dependent packages.
rvec 0.0.7
CRAN release: 2024-09-15
Changes to interface
- Removed
is.numericmethods for rvecs. These had been creating problems with functions from non-rvec packages, sinceis.numericgenerally implies that an object is a base R style numeric vector. - Removed space from around
=when printingrvec_lgl, so that, for instance,p = 0.5becomesp=0.5. -
rvec(),rvec_chr(),rvec_dbl(),rvec_int(), andrvec_lgl()now accept rvec arguments. -
draws_ci()now acceptswidtharguments with length greater than - Improved error messages from distribution functions.
New functions
- Added function
new_rvec(), which creates rvecs with specified values for type, length, andn_draw, consisting entirely of NAs. - Added function
extract_draw(), which extracts a single draw from an rvec.
rvec 0.0.6
CRAN release: 2023-11-08
Documentation
- Fixed typo in DESCRIPTION
- Added ‘value’ section to documentation for “missing”
- Added examples to documentation for “missing”
Interface
- Changed
anyNA()so it returns an rvec, rather than a logical scalar.
rvec 0.0.2
Bug fix
- Added
drop = FALSEargument to calls tomatrixStats::rowQuantiles()
rvec 0.0.1
Minor feature added
- Added method for
is.numeric(). (Can’t add methods foris.character(),is.double(),is.integer(),is.logical(), since these are non-generic primitives.