sparsevctrs
Sparse vector class using ALTREP. Contribute to r-lib/sparsevctrs development by creating an account on GitHub.
Sparse vectors stopped being a storage trick and became something you can do arithmetic on
◆Recent moves
- 8mo ago
Sparse character vector fix for R devel
Fixes a sparse character vector bug that appeared only under R devel. Forward-compatibility work ahead of the next R release, with no effect on current behaviour.
View source ↗ - 1y ago
Stack imbalance in sparse multiplication fixed
Fixes a stack imbalance in sparse_multiplication() when the result is all zeros, and a type error where sparse_is_na(type = "integer") failed on character vectors. The stack imbalance is a C-level defect in a function added only two releases earlier — the arithmetic layer is still settling.
View source ↗ - 1y ago
Sparse matrix coercion no longer errors on NA input
Fixes coerce_to_sparse_matrix() erroring on input containing NA values. Narrow, but this is the entry point into the whole package and NA-bearing input is the normal case for real data.
View source ↗ - 1y ago
sparsity() fixed for classed numeric vectors
Fixes sparsity() erroring on numeric vectors that carry a class attribute. A single-case guard on a utility function.
View source ↗ - 1y ago
Undefined behaviour in sparse multiplication fixed
Fixes undefined behaviour in sparse multiplication, one week after the function shipped. Undefined behaviour in a numerical kernel means results that are wrong unpredictably rather than wrong consistently, so this is a correctness fix rather than a cosmetic one.
View source ↗ - 1y ago
Scalar and element-wise arithmetic for sparse vectors
⚡ SPARKAdds the arithmetic layer: scalar division, multiplication, addition and subtraction, element-wise sparse_multiplication(), plus sparse_lag(), sparse_sqrt(), sparse_replace_na(), sparse_is_na() and sparse_which_na(). Together with the statistics added in 0.2.0, this is what turns a sparse storage format into something a preprocessing pipeline can compute against directly. Every bug fix in the five releases that follow lands in this new code.
View source ↗